Skip to content

Commit

Permalink
show a descriptive error when unit tests fail to load requirejs packa…
Browse files Browse the repository at this point in the history
…ge on node >= 12.16.0 (#2699)

This is related to a bug in "rewire" package. jhnns/rewire#178
  • Loading branch information
davidfirst authored Jun 7, 2020
1 parent 79b6a2a commit 211248f
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ require('resolve-dependency-path');
require('sass-lookup');
require('app-module-path');
require('module-definition');
require('module-lookup-amd');

try {
// eslint-disable-next-line global-require
require('module-lookup-amd');
} catch (err) {
// eslint-disable-next-line no-console
console.log(`mocha suppresses the error, so console.error is needed to show the error on the screen.
the problem is with module-lookup-amd that calls requirejs package and uses rewire package.
see https://github.com/jhnns/rewire/issues/178 for more details.
the error occurs since node v12.16.0. for the time being, to run the tests, use an earlier version.
`);
// eslint-disable-next-line no-console
console.error(err);
throw err;
}

describe('filing-cabinet', () => {
describe('JavaScript', () => {
Expand Down

0 comments on commit 211248f

Please sign in to comment.