-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move ESM fixtures to fixtures dir
Also consistently import the `common` module where possible. PR-URL: #19409 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Richard Lau <[email protected]>
- Loading branch information
Showing
24 changed files
with
30 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/example-loader.mjs | ||
/* eslint-disable node-core/required-modules */ | ||
import assert from 'assert'; | ||
import ok from './test-esm-ok.mjs'; | ||
import ok from '../fixtures/es-modules/test-esm-ok.mjs'; | ||
|
||
assert(ok); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
// Flags: --experimental-modules | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common/index'; | ||
import '../common'; | ||
import assert from 'assert'; | ||
import ok from './test-esm-ok.mjs'; | ||
import json from './json.json'; | ||
import ok from '../fixtures/es-modules/test-esm-ok.mjs'; | ||
import json from '../fixtures/es-modules/json.json'; | ||
|
||
assert(ok); | ||
assert.strictEqual(json.val, 42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-with-dep.mjs | ||
/* eslint-disable node-core/required-modules */ | ||
import './test-esm-ok.mjs'; | ||
import '../fixtures/es-modules/test-esm-ok.mjs'; | ||
|
||
// We just test that this module doesn't fail loading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/builtin-named-exports-loader.mjs | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common/index'; | ||
import '../common'; | ||
import { readFile } from 'fs'; | ||
import assert from 'assert'; | ||
import ok from './test-esm-ok.mjs'; | ||
import ok from '../fixtures/es-modules/test-esm-ok.mjs'; | ||
|
||
assert(ok); | ||
assert(readFile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// Flags: --experimental-modules | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-shared-dep.mjs | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common'; | ||
import assert from 'assert'; | ||
import './test-esm-ok.mjs'; | ||
import '../fixtures/es-modules/test-esm-ok.mjs'; | ||
import dep from '../fixtures/es-module-loaders/loader-dep.js'; | ||
|
||
assert.strictEqual(dep.format, 'esm'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#! }]) // isn't js | ||
// Flags: --experimental-modules | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common'; | ||
|
||
const isJs = true; | ||
export default isJs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// Flags: --experimental-modules | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common/index'; | ||
import './esm-snapshot-mutator'; | ||
import one from './esm-snapshot'; | ||
import '../common'; | ||
import '../fixtures/es-modules/esm-snapshot-mutator'; | ||
import one from '../fixtures/es-modules/esm-snapshot'; | ||
import assert from 'assert'; | ||
|
||
assert.strictEqual(one, 1); |
1 change: 0 additions & 1 deletion
1
test/es-module/esm-snapshot-mutator.js → ...xtures/es-modules/esm-snapshot-mutator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
'use strict'; | ||
module.exports = 1; |
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...ule/test-esm-double-encoding-native%20.js → ...les/test-esm-double-encoding-native%20.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const isJs = true; | ||
export default isJs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
'use strict'; | ||
require('../common'); | ||
const fixtures = require('../common/fixtures'); | ||
const { execFileSync } = require('child_process'); | ||
|
||
const node = process.argv[0]; | ||
|
||
execFileSync(node, ['--experimental-modules', 'test/es-module/test-esm-ok']); | ||
execFileSync(node, ['--experimental-modules', | ||
'test/fixtures/es-modules/noext']); | ||
fixtures.path('es-modules', 'test-esm-ok')]); | ||
execFileSync(node, ['--experimental-modules', | ||
fixtures.path('es-modules', 'noext')]); |