diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-03-17 12:45:22 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-21 20:08:30 +0100 |
commit | fddcd6253b237ca68430f44c7614bf52d57c4f97 (patch) | |
tree | 56860db681a37731705126654e0bcd77612ce3bf /test/fixtures | |
parent | 9b7a6914a7f0bd754e78b42b48c75851cfd6b3c4 (diff) | |
download | android-node-v8-fddcd6253b237ca68430f44c7614bf52d57c4f97.tar.gz android-node-v8-fddcd6253b237ca68430f44c7614bf52d57c4f97.tar.bz2 android-node-v8-fddcd6253b237ca68430f44c7614bf52d57c4f97.zip |
test: move ESM fixtures to fixtures dir
Also consistently import the `common` module where possible.
PR-URL: https://github.com/nodejs/node/pull/19409
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/es-modules/esm-snapshot-mutator.js | 4 | ||||
-rw-r--r-- | test/fixtures/es-modules/esm-snapshot.js | 2 | ||||
-rw-r--r-- | test/fixtures/es-modules/json.json | 3 | ||||
-rw-r--r-- | test/fixtures/es-modules/test-esm-double-encoding-native%20.js | 6 | ||||
-rw-r--r-- | test/fixtures/es-modules/test-esm-ok.mjs | 2 |
5 files changed, 17 insertions, 0 deletions
diff --git a/test/fixtures/es-modules/esm-snapshot-mutator.js b/test/fixtures/es-modules/esm-snapshot-mutator.js new file mode 100644 index 0000000000..ee52c270f6 --- /dev/null +++ b/test/fixtures/es-modules/esm-snapshot-mutator.js @@ -0,0 +1,4 @@ +'use strict'; +const shouldSnapshotFilePath = require.resolve('./esm-snapshot.js'); +require('./esm-snapshot.js'); +require.cache[shouldSnapshotFilePath].exports++; diff --git a/test/fixtures/es-modules/esm-snapshot.js b/test/fixtures/es-modules/esm-snapshot.js new file mode 100644 index 0000000000..329a0ca3f4 --- /dev/null +++ b/test/fixtures/es-modules/esm-snapshot.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = 1; diff --git a/test/fixtures/es-modules/json.json b/test/fixtures/es-modules/json.json new file mode 100644 index 0000000000..8288d42e2b --- /dev/null +++ b/test/fixtures/es-modules/json.json @@ -0,0 +1,3 @@ +{ + "val": 42 +} diff --git a/test/fixtures/es-modules/test-esm-double-encoding-native%20.js b/test/fixtures/es-modules/test-esm-double-encoding-native%20.js new file mode 100644 index 0000000000..ea1caa81be --- /dev/null +++ b/test/fixtures/es-modules/test-esm-double-encoding-native%20.js @@ -0,0 +1,6 @@ +'use strict'; + +// Trivial test to assert we can load files with `%` in their pathname. +// Imported by `test-esm-double-encoding.mjs`. + +module.exports = 42; diff --git a/test/fixtures/es-modules/test-esm-ok.mjs b/test/fixtures/es-modules/test-esm-ok.mjs new file mode 100644 index 0000000000..7dfc6eb587 --- /dev/null +++ b/test/fixtures/es-modules/test-esm-ok.mjs @@ -0,0 +1,2 @@ +const isJs = true; +export default isJs; |