[Pkg-javascript-devel] Bug#930917: Bug#930917: Bug#930917: Include import test like require test when package.json#module is present

Jonas Smedegaard jonas at jones.dk
Tue Jul 9 12:53:13 BST 2019


Quoting Pirate Praveen (2019-07-09 06:27:36)
> 
> 
> On 2019, ജൂലൈ 9 2:12:43 PM IST, Xavier <yadd at debian.org> wrote:
> >Hello,
> >
> >pkg-js-autopkgtest launches 2 tests:
> > - a `node -e 'require("package")'
> > - upstream tests on installed files
> >
> >is it enough ?
> 
> For packages that only provide commonjs/umd modules, that should be enough.
> 
> For packages that also provide ES module, we should test they are installed properly. This can be confirmed if package.json has a "module" field or not. 
> 
> We could write a ES6 js file with import * from "package" and run rollup on it as node does not natively support import yet.
> 
> es-module-test.js:
> 
> import * from "package"
> 
> Then run,
> 
> rollup es-module-test.js -f umd -o bundle.js
> 
> Or possibly,
> es-module-test.mjs:
> import * from "package"
> 
> node --experimental-modules  es-module-test.js
> 
> Note: not tested the code

Sounds like this - what kinds of tests are relevant for which kinds of 
javascript packages - is quite helpful generally: Could you wizards 
please consider putting such info on a wiki page?


Thanks a lot for looking into this!

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20190709/17262e46/attachment.sig>


More information about the Pkg-javascript-devel mailing list