File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
tests/fixtures/webext-as-library Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change 1- const assert = require ( 'assert' ) ;
2-
31const { testModuleExports, testModuleExportedUtils} = require ( './helpers.js' ) ;
42
53
64( async ( ) => {
7- // Trying to require web-ext as a CommonJS module is not supported anymore
8- // and it should be throwing the expected ERR_REQUIRE_ESM error.
9- assert . throws (
10- ( ) => require ( 'web-ext' ) ,
11- {
12- name : 'Error' ,
13- code : 'ERR_REQUIRE_ESM' ,
14- }
15- ) ;
16-
17- // But it should still be possible to import it in a CommonJS module
18- // using a dynamic import.
5+ // Prior to Node v20.19, it was not possible to load web-ext with `require()`
6+ // but that changed in Node v20.19 according to
7+ // https://nodejs.org/en/blog/release/v20.19.0#requireesm-is-now-enabled-by-default.
8+ //
9+ // We are not going to verify that. Instead, we only verify that we can
10+ // import web-ext using a dynamic import in a CommonJS module.
1911 const { cmd, main} = await import ( 'web-ext' ) ; // eslint-disable-line import/no-unresolved
2012
2113 await testModuleExports ( { cmd, main} ) ;
You can’t perform that action at this time.
0 commit comments