Skip to content

Does not seem to work with type=module in package.json #9

@kevinsimper

Description

@kevinsimper

I am trying to use type=module in package.json

and I have a setup file that is loaded in jest config.

and loading jest with this

NODE_OPTIONS="--experimental-vm-modules --loader=testdouble" npx jest

And I get this error message

$ NODE_OPTIONS="--experimental-vm-modules --loader=testdouble" npx jest
Build finished; total time 160ms, incrementality 100.0%. Outputs:
(node:1) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, getSource
(node:17) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:17) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, getSource
(node:17) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(node:71) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:72) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:78) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:71) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, getSource
(node:78) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, getSource
(node:72) DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: getFormat, getSource
(node:71) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(node:78) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(node:72) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
 PASS  dist/add.test.js
 FAIL  dist/services/xxx/xxx.test.js
  ● Test suite failed to run

    testdouble ESM loader not loaded. You cannot replace ES modules without a loader. Run node with `--loader=testdouble`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions