[Pkg-javascript-devel] Bug#1001526: On node-svgo

Pirate Praveen praveen at onenetbeyond.org
Sat Dec 11 16:35:55 GMT 2021



On ശ, ഡിസം 11 2021 at 05:28:13 വൈകു +0100 +0100, Yadd 
<yadd at debian.org> wrote:
> On 11/12/2021 16:21, Pirate Praveen wrote:
>> 
>> 
>> On ശ, ഡിസം 11 2021 at 01:48:18 വൈകു +0100 +0100, 
>> Julien Puydt <julien.puydt at gmail.com> wrote:
>>> Hi,
>>> 
>>> Le samedi 11 décembre 2021 à 13:24 +0100, Yadd a écrit :
>>>> 
>>>>  echo -n require > debian/tests/pkg-js/SKIP
>>> 
>>> Good one!
>>> 
>>> How does one test an import-able module?
>> 
>> Create test.mjs as
>> import {loadJsonFile} from 'load-json-file';
>> 
>> node test.mjs
>> 
>> or more generic
>> import * as loadJSONFile from 'load-json-file';
>> 
>> or even simpler
>> 
>> import 'load-json-file';
> 
> This does not work with node 12

I tested in node 12 only

load-json-file was installed via npm i load-json-file

(debian-sid)pravi at mahishi:/tmp$ cat test.mjs
import 'load-json-file';(debian-sid)pravi at mahishi:/tmp$ node -v
v12.22.7
(debian-sid)pravi at mahishi:/tmp$ apt policy nodejs
nodejs:
  Installed: 12.22.7~dfsg-2
  Candidate: 12.22.7~dfsg-2
  Version table:
     16.13.0~dfsg-5 1
          1 http://deb.debian.org/debian experimental/main amd64 
Packages
 *** 12.22.7~dfsg-2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
        100 /var/lib/dpkg/status
(debian-sid)pravi at mahishi:/tmp$ node test.mjs
(debian-sid)pravi at mahishi:/tmp$ echo $?
0
(debian-sid)pravi at mahishi:/tmp$



More information about the Pkg-javascript-devel mailing list