Skip to content

Commit

Permalink
test: clearing require cache crashes esm loader
Browse files Browse the repository at this point in the history
This test shows the regression introduced in v11.4.0: clearing out the
require.cache crashes node when using the `--experimental-modules` flag.
Refs: #25482
  • Loading branch information
aduh95 committed May 2, 2019
1 parent 31b3dd2 commit a3b07f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/known_issues/test-esm-loader-cache-clearing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Flags: --experimental-modules
'use strict';
require('../common');

const { cache } = require;

Object.keys(cache).forEach((key) => {
delete cache[key];
});
// Require the same module again triggers the crash
require('../common');

0 comments on commit a3b07f6

Please sign in to comment.