Package: node-vue-style-loader
Version: 4.1.2-1
severity: wishlist

As continuation of https://alioth-lists.debian.net/pipermail/pkg-javascript-devel/2020-December/048394.html

I tried running the test with babeljs-node after embedding missing node-environment-flags in debian/test/test_modules and exporting NODE_PATH=debian/tests/test_modules in debian/tests/pkg-js/test

These steps are workaround for this bug,
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977232

+ /usr/bin/babeljs-node /usr/bin/jest
FAIL test/test.js
 ● Test suite failed to run

   Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

   Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it. • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config. • If you need a custom transformation specify a "transform" option in your config. • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
   https://jestjs.io/docs/en/configuration.html

   Details:

   /usr/share/nodejs/vue-style-loader/lib/addStylesClient.js:6
   import listToStyles from './listToStyles';
   ^^^^^^

   SyntaxError: Cannot use import statement outside a module

     1093 | try {
1094 | const scriptFilename = this._resolver.isCoreModule(filename) ? `jest-nodejs-core-${filename}` : filename; > 1095 | return new (_vm().Script)(this.wrapCodeInModuleWrapper(scriptSource), {
          | ^
     1096 | displayErrors: true,
     1097 | filename: scriptFilename,
     1098 | // @ts-expect-error: Experimental ESM API

at Runtime.createScriptFromCode (../../../../../usr/share/nodejs/jest-runtime/build/index.js:1095:14)
     at Object.<anonymous> (test/test.js:1:1)

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.643 s
Ran all test suites.
autopkgtest [02:34:48]: test pkg-js-autopkgtest: -----------------------] autopkgtest [02:34:48]: test pkg-js-autopkgtest: - - - - - - - - - - results - - - - - - - - - -
pkg-js-autopkgtest FAIL non-zero exit status 1
autopkgtest [02:34:48]: @@@@@@@@@@@@@@@@@@@@ summary
pkg-js-autopkgtest-require PASS (superficial)
pkg-js-autopkgtest FAIL non-zero exit status 1

I'm out of ideas for this.

--
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to