PKG-JS-AUTOPKGTEST(7) | Miscellaneous Information Manual | PKG-JS-AUTOPKGTEST(7) |
pkg-js-autopkgtest - autopkgtest runner to automatically test Node.js packages
That's all, other debian/tests files will be written on-the-fly by
autodep8 during autopkgtest
If you want to launch the same test during build, simply add
dh-sequence-nodejs in build dependencies
... Testsuite: autopkgtest-pkg-nodejs Build-Depends: dh-sequence-nodejs ...
mocha -R spec
autodep8 allows one to add additional packages during autopkgtest
(and/or
additional restrictions) by using a
debian/tests/autopkgtest-pkg-nodejs.conf
file:
extra_depends=mocha, npm extra-restrictions=needs-internet
Since version 0.15.0, pkg-js-autopkgtest launches Node.js with
--disable-proto=throw. This causes tests to fail if
Object.prototype.__proto__ property is used.
If a package can use this feature without security hole (for test
for example),
it is possible to disable this nodejs option by creating an empty
debian/tests/pkg-js/enable_proto file, until Debian's Node.js enables
this
feature by default.
First, pkg\-js\-autopkgtest searches the module name.
Then pkg\-js\-autopkgtest looks at package.json fields, not
using the file
mentioned above, but using the file installed by the Debian package to test
(ie \fB/usr/share/nodejs/<module\-name>/package\.json\fP):
Since version 0.10.0, pkg\-js\-autopkgtest does the same
test for all other
modules installed in nodejs root directories (components installed by
.br dh\-sequence\-nodejs using \fBdebian/nodejs/root_modules\fP
file). If one fail, the
whole test is marked as failed.
Returned values:
If you want to skip some secondary module tests, simply list them
in
debian/tests/pkg-js/require-SKIP (one module per line).
If you want to skip the whole "require" test, use this:
echo require > debian/tests/pkg-js/SKIP
pkg\-js\-autopkgtest uses the same test than
dh\-sequence\-nodejs: it
launches sh -ex debian/tests/pkg-js/test but using the files installed
by
the Debian package.
pkg\-js\-autopkgtest search for module name using the same
way than "require"
test. Then it prepares the test environment:
Then it changes its directory to the temporary one launches the
test using
sh -ex debian/tests/pkg-js/test.
Copyright Yadd <yadd@debian.org>
This library is free software; you can redistribute it and/or
modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
On Debian systems, the complete text of version 2 of the GNU
General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
If not, see GNU
licenses;
November 2022 |