diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-13 09:35:55 +0100 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-12-15 06:55:02 -0800 |
commit | 139525618779790f05dec3aa75c997a79ba86120 (patch) | |
tree | 941c58186160c78ac562dc47807c299e97a6d38e /test/es-module | |
parent | 83360899db901a3eace976adff749006fbcee8a7 (diff) | |
download | android-node-v8-139525618779790f05dec3aa75c997a79ba86120.tar.gz android-node-v8-139525618779790f05dec3aa75c997a79ba86120.tar.bz2 android-node-v8-139525618779790f05dec3aa75c997a79ba86120.zip |
test: run eslint on test file and fix errors
This removes two entries from the eslint ignore file. One file does
not exist anymore and the other one could easily be fixed.
PR-URL: https://github.com/nodejs/node/pull/25009
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/es-module')
-rw-r--r-- | test/es-module/test-esm-dynamic-import.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/es-module/test-esm-dynamic-import.js b/test/es-module/test-esm-dynamic-import.js index 0023b5f2d8..8873399776 100644 --- a/test/es-module/test-esm-dynamic-import.js +++ b/test/es-module/test-esm-dynamic-import.js @@ -11,7 +11,7 @@ targetURL.pathname = absolutePath; function expectErrorProperty(result, propertyKey, value) { Promise.resolve(result) - .catch(common.mustCall(error => { + .catch(common.mustCall((error) => { assert.strictEqual(error[propertyKey], value); })); } @@ -22,15 +22,16 @@ function expectMissingModuleError(result) { function expectOkNamespace(result) { Promise.resolve(result) - .then(common.mustCall(ns => { + .then(common.mustCall((ns) => { // Can't deepStrictEqual because ns isn't a normal object + // eslint-disable-next-line no-restricted-properties assert.deepEqual(ns, { default: true }); })); } function expectFsNamespace(result) { Promise.resolve(result) - .then(common.mustCall(ns => { + .then(common.mustCall((ns) => { assert.strictEqual(typeof ns.default.writeFile, 'function'); assert.strictEqual(typeof ns.writeFile, 'function'); })); @@ -41,19 +42,19 @@ function expectFsNamespace(result) { (function testScriptOrModuleImport() { // Importing another file, both direct & via eval // expectOkNamespace(import(relativePath)); - expectOkNamespace(eval.call(null, `import("${relativePath}")`)); expectOkNamespace(eval(`import("${relativePath}")`)); - expectOkNamespace(eval.call(null, `import("${targetURL}")`)); + expectOkNamespace(eval(`import("${relativePath}")`)); + expectOkNamespace(eval(`import("${targetURL}")`)); // Importing a built-in, both direct & via eval - expectFsNamespace(import("fs")); + expectFsNamespace(import('fs')); + expectFsNamespace(eval('import("fs")')); expectFsNamespace(eval('import("fs")')); - expectFsNamespace(eval.call(null, 'import("fs")')); - expectMissingModuleError(import("./not-an-existing-module.mjs")); + expectMissingModuleError(import('./not-an-existing-module.mjs')); // TODO(jkrems): Right now this doesn't hit a protocol error because the // module resolution step already rejects it. These arguably should be // protocol errors. - expectMissingModuleError(import("node:fs")); + expectMissingModuleError(import('node:fs')); expectMissingModuleError(import('http://example.com/foo.js')); })(); |