vendredi 15 décembre 2017

Running tests .mjs / ESM on Node using Jasmine or any other alternative

My Node-based project is implemented using native ES module support on Node thanks to the --experimental-modules CLI switch (i.e. node --experimental-modules).

Obviously, when I run a spec using Jasmine node --experimental-modules ./node_modules/jasmine/bin/jasmine I get the following error:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module

Is it ever possible to use Jasmine using ES modules in Node?

If not, is there any alternative to don't use a framework (e.g. running tests with npm scripts)?

Aucun commentaire:

Enregistrer un commentaire