Esm: V3.0.34 not working with jest.

Created on 14 May 2018  路  2Comments  路  Source: standard-things/esm

Thanks a lot for this awesome module!

I'm trying to run my jest test with esm it's failing with this error:

screen shot 2018-05-14 at 3 31 44 pm

My package.json

{
  "dependencies": {
    "esm": "^3.0.34"
  },
  "scripts": {
    "start": "node -r esm index.js",
    "test": "node -r esm node_modules/.bin/jest"
  },
  "esm": {
    "mode": "auto",
    "await": true,
    "cjs": {
      "vars": true,
      "interop": true,
      "namedExports": true
    }
  },
  "devDependencies": {
    "jest": "^22.4.3"
  }
}

index.js

import modulex from './modulex';
console.log(modulex);

modulex.js

export default {
    name: 'im module x'
};

test.js

import modulex from './modulex';

test('Test', () => {
    console.log(modulex);
});

When i run yarn start # or npm start everything works without problems, so i guess the configuration it's fine.

question

Most helpful comment

@gbahamondezc jest is not supported yet, but @jdalton is working on it.

you can follow up here: https://github.com/facebook/jest/issues/4842

All 2 comments

@gbahamondezc jest is not supported yet, but @jdalton is working on it.

you can follow up here: https://github.com/facebook/jest/issues/4842

@dnalborczyk ok, thanks 馃憤

Was this page helpful?
0 / 5 - 0 ratings