[njs] Test262: making "fs" module required.

noreply at nginx.com noreply at nginx.com
Thu Dec 19 20:19:04 UTC 2024


details:   https://github.com/nginx/njs/commit/958f8f095b6a302c746c51a16819ce91f8ec8458
branches:  master
commit:    958f8f095b6a302c746c51a16819ce91f8ec8458
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed, 4 Dec 2024 17:07:22 -0800
description:
Test262: making "fs" module required.


---
 test/fs/{methods.t.js => methods.t.mjs}            | 58 +++++++++++-----------
 test/fs/{promises_01.t.js => promises_01.t.mjs}    |  7 +--
 test/fs/{promises_02.t.js => promises_02.t.mjs}    | 11 ++--
 test/fs/{promises_03.t.js => promises_03.t.mjs}    | 11 ++--
 test/fs/{promises_04.t.js => promises_04.t.mjs}    |  2 +-
 test/fs/{promises_05.t.js => promises_05.t.mjs}    | 11 ++--
 test/fs/{promises_06.t.js => promises_06.t.mjs}    | 11 ++--
 test/fs/{promises_07.t.js => promises_07.t.mjs}    |  2 +-
 test/fs/{promises_08.t.js => promises_08.t.mjs}    |  7 +--
 test/fs/{promises_09.t.js => promises_09.t.mjs}    |  2 +-
 test/harness/compatFs.js                           | 16 +-----
 test/webcrypto/{aes.t.js => aes.t.mjs}             |  2 +-
 .../{aes_decoding.t.js => aes_decoding.t.mjs}      |  2 +-
 test/webcrypto/{derive.t.js => derive.t.mjs}       |  2 +-
 test/webcrypto/{digest.t.js => digest.t.mjs}       |  2 +-
 test/webcrypto/{export.t.js => export.t.mjs}       |  8 +--
 test/webcrypto/{rsa.t.js => rsa.t.mjs}             |  2 +-
 .../{rsa_decoding.t.js => rsa_decoding.t.mjs}      |  2 +-
 test/webcrypto/{sign.t.js => sign.t.mjs}           |  8 +--
 test/webcrypto/{verify.t.js => verify.t.mjs}       |  8 +--
 test/xml/{saml_verify.t.js => saml_verify.t.mjs}   |  2 +-
 21 files changed, 73 insertions(+), 103 deletions(-)

diff --git a/test/fs/methods.t.js b/test/fs/methods.t.mjs
similarity index 95%
rename from test/fs/methods.t.js
rename to test/fs/methods.t.mjs
index 72afb494..9b695296 100644
--- a/test/fs/methods.t.js
+++ b/test/fs/methods.t.mjs
@@ -157,7 +157,7 @@ let readfile_tests = () => [
 
 let readFile_tsuite = {
     name: "fs readFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readfile_test,
     prepare_args: p,
     opts: { type: "callback" },
@@ -166,7 +166,7 @@ let readFile_tsuite = {
 
 let readFileSync_tsuite = {
     name: "fs readFileSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readfile_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -175,7 +175,7 @@ let readFileSync_tsuite = {
 
 let readFileP_tsuite = {
     name: "fsp readFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readfile_test,
     prepare_args: p,
     opts: { type: "promise" },
@@ -246,7 +246,7 @@ let writefile_tests = () => [
 
 let writeFile_tsuite = {
     name: "fs writeFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: writefile_test,
     prepare_args: p,
     opts: { type: "callback" },
@@ -255,7 +255,7 @@ let writeFile_tsuite = {
 
 let writeFileSync_tsuite = {
     name: "fs writeFileSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: writefile_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -264,7 +264,7 @@ let writeFileSync_tsuite = {
 
 let writeFileP_tsuite = {
     name: "fsp writeFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: writefile_test,
     prepare_args: p,
     opts: { type: "promise" },
@@ -336,7 +336,7 @@ let append_tests = () => [
 
 let appendFile_tsuite = {
     name: "fs appendFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: append_test,
     prepare_args: p,
     opts: { type: "callback" },
@@ -345,7 +345,7 @@ let appendFile_tsuite = {
 
 let appendFileSync_tsuite = {
     name: "fs appendFileSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: append_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -354,7 +354,7 @@ let appendFileSync_tsuite = {
 
 let appendFileP_tsuite = {
     name: "fsp appendFile",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: append_test,
     prepare_args: p,
     opts: { type: "promise" },
@@ -384,7 +384,7 @@ let exists_tests = () => [
 
 let existsSync_tsuite = {
     name: "fs existsSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: exists_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -410,7 +410,7 @@ let realpath_tests = () => [
 
 let realpath_tsuite = {
     name: "fs realpath",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: realpath_test,
     prepare_args: p,
     opts: { type: "callback" },
@@ -419,7 +419,7 @@ let realpath_tsuite = {
 
 let realpathSync_tsuite = {
     name: "fs realpathSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: realpath_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -428,7 +428,7 @@ let realpathSync_tsuite = {
 
 let realpathP_tsuite = {
     name: "fsp realpath",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: realpath_test,
     prepare_args: p,
     opts: { type: "promise" },
@@ -460,7 +460,7 @@ let readlink_tests = () => [
 
 let readlink_tsuite = {
     name: "fs readlink",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readlink_test,
     prepare_args: p,
     opts: { type: "callback" },
@@ -469,7 +469,7 @@ let readlink_tsuite = {
 
 let readlinkSync_tsuite = {
     name: "fs readlinkSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readlink_test,
     prepare_args: p,
     opts: { type: "sync" },
@@ -478,7 +478,7 @@ let readlinkSync_tsuite = {
 
 let readlinkP_tsuite = {
     name: "fsp readlink",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readlink_test,
     prepare_args: p,
     opts: { type: "promise" },
@@ -620,7 +620,7 @@ let stat_tests = () => [
 
 let stat_tsuite = {
     name: "fs stat",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "callback", method: "stat" },
@@ -629,7 +629,7 @@ let stat_tsuite = {
 
 let statSync_tsuite = {
     name: "fs statSync",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "sync", method: "stat" },
@@ -638,7 +638,7 @@ let statSync_tsuite = {
 
 let statP_tsuite = {
     name: "fsp stat",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "promise", method: "stat" },
@@ -647,7 +647,7 @@ let statP_tsuite = {
 
 let lstat_tsuite = {
     name: "fs lstat",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "callback", method: "lstat" },
@@ -656,7 +656,7 @@ let lstat_tsuite = {
 
 let lstatSync_tsuite = {
     name: "fs lstatSync",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "sync", method: "lstat" },
@@ -665,7 +665,7 @@ let lstatSync_tsuite = {
 
 let lstatP_tsuite = {
     name: "fsp lstat",
-    skip: () => (!has_fs() || !has_fs_symbolic_link() || !has_buffer()),
+    skip: () => (!has_fs_symbolic_link() || !has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "promise", method: "lstat" },
@@ -770,7 +770,7 @@ let open_tests = () => [
 
 let openSync_tsuite = {
     name: "fs openSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "sync", method: "open" },
@@ -779,7 +779,7 @@ let openSync_tsuite = {
 
 let openP_tsuite = {
     name: "fsp open",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: method_test,
     prepare_args: p,
     opts:  { type: "promise", method: "open" },
@@ -813,7 +813,7 @@ let close_tests = () => [
 
 let closeSync_tsuite = {
     name: "fs closeSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: method_test,
     prepare_args: p,
     opts: { type: "sync", method: "close" },
@@ -1005,7 +1005,7 @@ let read_tests = () => [
 
 let readSync_tsuite = {
     name: "fs readSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: read_test,
     prepare_args: p,
     opts: {},
@@ -1014,7 +1014,7 @@ let readSync_tsuite = {
 
 let readFh_tsuite = {
     name: "fh read",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: readFh_test,
     prepare_args: p,
     opts: {},
@@ -1210,7 +1210,7 @@ let write_tests = () => [
 
 let writeSync_tsuite = {
     name: "fs writeSync",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: write_test,
     prepare_args: p,
     opts: {},
@@ -1219,7 +1219,7 @@ let writeSync_tsuite = {
 
 let writeFh_tsuite = {
     name: "fh write",
-    skip: () => (!has_fs() || !has_buffer()),
+    skip: () => (!has_buffer()),
     T: writeFh_test,
     prepare_args: p,
     opts: {},
diff --git a/test/fs/promises_01.t.js b/test/fs/promises_01.t.mjs
similarity index 87%
rename from test/fs/promises_01.t.js
rename to test/fs/promises_01.t.mjs
index 69f0ce38..74628d45 100644
--- a/test/fs/promises_01.t.js
+++ b/test/fs/promises_01.t.mjs
@@ -41,10 +41,7 @@ let test = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(test)
-        .then(() => assert.compareArray(stages, ["init", "short circut", "chain", "errors ok"]))
-}
+    .then(test)
+    .then(() => assert.compareArray(stages, ["init", "short circut", "chain", "errors ok"]))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_02.t.js b/test/fs/promises_02.t.mjs
similarity index 91%
rename from test/fs/promises_02.t.js
rename to test/fs/promises_02.t.mjs
index 604ac8ca..36cd480a 100644
--- a/test/fs/promises_02.t.js
+++ b/test/fs/promises_02.t.mjs
@@ -80,12 +80,9 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(testSync)
-        .then(testCallback)
-        .then(testFsp)
-        .then(() => assert.compareArray(stages, ["testSync", "testCallback", "testPromise"]))
-}
+    .then(testSync)
+    .then(testCallback)
+    .then(testFsp)
+    .then(() => assert.compareArray(stages, ["testSync", "testCallback", "testPromise"]))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_03.t.js b/test/fs/promises_03.t.mjs
similarity index 92%
rename from test/fs/promises_03.t.js
rename to test/fs/promises_03.t.mjs
index 491d9903..a5e2d072 100644
--- a/test/fs/promises_03.t.js
+++ b/test/fs/promises_03.t.mjs
@@ -94,12 +94,9 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(testSync)
-        .then(testCallback)
-        .then(testFsp)
-        .then(() => assert.compareArray(stages, ['unlinkSync', 'unlink', 'fsp.unlink']))
-}
+    .then(testSync)
+    .then(testCallback)
+    .then(testFsp)
+    .then(() => assert.compareArray(stages, ['unlinkSync', 'unlink', 'fsp.unlink']))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_04.t.js b/test/fs/promises_04.t.mjs
similarity index 99%
rename from test/fs/promises_04.t.js
rename to test/fs/promises_04.t.mjs
index 763e0954..396d4803 100644
--- a/test/fs/promises_04.t.js
+++ b/test/fs/promises_04.t.mjs
@@ -180,7 +180,7 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs() && has_fs_symbolic_link()) {
+if (has_fs_symbolic_link()) {
     p = p
         .then(testSync)
         .then(testCallback)
diff --git a/test/fs/promises_05.t.js b/test/fs/promises_05.t.mjs
similarity index 95%
rename from test/fs/promises_05.t.js
rename to test/fs/promises_05.t.mjs
index e40dfb1f..1fe33be4 100644
--- a/test/fs/promises_05.t.js
+++ b/test/fs/promises_05.t.mjs
@@ -143,12 +143,9 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(testSync)
-        .then(testCallback)
-        .then(testFsp)
-        .then(() => assert.compareArray(stages, ['mkdirSync', 'mkdir', 'fsp.mkdir']))
-}
+    .then(testSync)
+    .then(testCallback)
+    .then(testFsp)
+    .then(() => assert.compareArray(stages, ['mkdirSync', 'mkdir', 'fsp.mkdir']))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_06.t.js b/test/fs/promises_06.t.mjs
similarity index 92%
rename from test/fs/promises_06.t.js
rename to test/fs/promises_06.t.mjs
index 91fdba01..104b4a5b 100644
--- a/test/fs/promises_06.t.js
+++ b/test/fs/promises_06.t.mjs
@@ -94,12 +94,9 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(testSync)
-        .then(testCallback)
-        .then(testFsp)
-        .then(() => assert.compareArray(stages, ["renameSync", "rename", "fsp.rename"]))
-}
+    .then(testSync)
+    .then(testCallback)
+    .then(testFsp)
+    .then(() => assert.compareArray(stages, ["renameSync", "rename", "fsp.rename"]))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_07.t.js b/test/fs/promises_07.t.mjs
similarity index 99%
rename from test/fs/promises_07.t.js
rename to test/fs/promises_07.t.mjs
index f32b11a5..02b12a3a 100644
--- a/test/fs/promises_07.t.js
+++ b/test/fs/promises_07.t.mjs
@@ -229,7 +229,7 @@ let testFsp = () => Promise.resolve()
 })
 
 let p = Promise.resolve()
-if (has_fs() && has_fs_symbolic_link()) {
+if (has_fs_symbolic_link()) {
     p = p
         .then(testSync)
         .then(testCallback)
diff --git a/test/fs/promises_08.t.js b/test/fs/promises_08.t.mjs
similarity index 94%
rename from test/fs/promises_08.t.js
rename to test/fs/promises_08.t.mjs
index cffa7c20..d3efa820 100644
--- a/test/fs/promises_08.t.js
+++ b/test/fs/promises_08.t.mjs
@@ -78,10 +78,7 @@ var testSync = () => new Promise((resolve, reject) => {
 });
 
 let p = Promise.resolve()
-if (has_fs()) {
-    p = p
-        .then(testSync)
-        .then(() => assert.compareArray(stages, ["mkdirSync"]))
-}
+    .then(testSync)
+    .then(() => assert.compareArray(stages, ["mkdirSync"]))
 
 p.then($DONE, $DONE);
diff --git a/test/fs/promises_09.t.js b/test/fs/promises_09.t.mjs
similarity index 98%
rename from test/fs/promises_09.t.js
rename to test/fs/promises_09.t.mjs
index 91789eed..480f54b5 100644
--- a/test/fs/promises_09.t.js
+++ b/test/fs/promises_09.t.mjs
@@ -101,7 +101,7 @@ var testSync = () => new Promise((resolve, reject) => {
 });
 
 let p = Promise.resolve()
-if (has_fs() && has_fs_symbolic_link()) {
+if (has_fs_symbolic_link()) {
     p = p
         .then(testSync)
         .then(() => assert.compareArray(stages, ['rmdirSync']))
diff --git a/test/harness/compatFs.js b/test/harness/compatFs.js
index dd96a592..911be465 100644
--- a/test/harness/compatFs.js
+++ b/test/harness/compatFs.js
@@ -1,10 +1,5 @@
-let fs = null;
-let fsp = null;
-
-if (typeof require == 'function') {
-    fs = require('fs');
-    fsp = fs.promises;
-}
+import fs from 'fs';
+let fsp = fs.promises;
 
 if (typeof process == 'undefined') {
     globalThis.process = {};
@@ -13,14 +8,7 @@ if (typeof process == 'undefined') {
 let test_dir = process.env && process.env['NJS_TEST_DIR'] || 'build';
 test_dir = `${test_dir}/test`;
 
-function has_fs() {
-    return fs;
-}
-
 function has_fs_symbolic_link() {
-    if (!fs) {
-        return false;
-    }
 
     let fname = test_dir + '/a';
     let lname = test_dir + '/b';
diff --git a/test/webcrypto/aes.t.js b/test/webcrypto/aes.t.mjs
similarity index 98%
rename from test/webcrypto/aes.t.js
rename to test/webcrypto/aes.t.mjs
index 1f5c136f..80cddabb 100644
--- a/test/webcrypto/aes.t.js
+++ b/test/webcrypto/aes.t.mjs
@@ -46,7 +46,7 @@ function p(args, default_opts) {
 
 let aes_tsuite = {
     name: "AES encoding/decoding",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/aes_decoding.t.js b/test/webcrypto/aes_decoding.t.mjs
similarity index 97%
rename from test/webcrypto/aes_decoding.t.js
rename to test/webcrypto/aes_decoding.t.mjs
index c1aff369..80eaf642 100644
--- a/test/webcrypto/aes_decoding.t.js
+++ b/test/webcrypto/aes_decoding.t.mjs
@@ -40,7 +40,7 @@ function p(args, default_opts) {
 
 let aes_tsuite = {
     name: "AES decoding",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/derive.t.js b/test/webcrypto/derive.t.mjs
similarity index 98%
rename from test/webcrypto/derive.t.js
rename to test/webcrypto/derive.t.mjs
index 60a21889..5ac13459 100644
--- a/test/webcrypto/derive.t.js
+++ b/test/webcrypto/derive.t.mjs
@@ -43,7 +43,7 @@ function p(args, default_opts) {
 
 let derive_tsuite = {
     name: "derive",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/digest.t.js b/test/webcrypto/digest.t.mjs
similarity index 97%
rename from test/webcrypto/digest.t.js
rename to test/webcrypto/digest.t.mjs
index f6413348..4318fe16 100644
--- a/test/webcrypto/digest.t.js
+++ b/test/webcrypto/digest.t.mjs
@@ -22,7 +22,7 @@ function p(args) {
 
 let digest_tsuite = {
     name: "SHA digest",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: { },
diff --git a/test/webcrypto/export.t.js b/test/webcrypto/export.t.mjs
similarity index 99%
rename from test/webcrypto/export.t.js
rename to test/webcrypto/export.t.mjs
index 631b3fa6..81b549df 100644
--- a/test/webcrypto/export.t.js
+++ b/test/webcrypto/export.t.mjs
@@ -247,7 +247,7 @@ function validate_rsa_jwk(exp, params) {
 
 let rsa_tsuite = {
     name: "RSA exporting",
-    skip: () => (!has_fs() || !has_webcrypto()),
+    skip: () => (!has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -368,7 +368,7 @@ function validate_ec_jwk(exp, params) {
 
 let ec_tsuite = {
     name: "EC exporting",
-    skip: () => (!has_fs() || !has_webcrypto()),
+    skip: () => (!has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -430,7 +430,7 @@ function validate_hmac_jwk(exp, params) {
 
 let hmac_tsuite = {
     name: "HMAC exporting",
-    skip: () => (!has_fs() || !has_webcrypto()),
+    skip: () => (!has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -515,7 +515,7 @@ function validate_aes_jwk(exp, params) {
 
 let aes_tsuite = {
     name: "AES exporting",
-    skip: () => (!has_fs() || !has_webcrypto()),
+    skip: () => (!has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/rsa.t.js b/test/webcrypto/rsa.t.mjs
similarity index 98%
rename from test/webcrypto/rsa.t.js
rename to test/webcrypto/rsa.t.mjs
index b87a0909..977537e0 100644
--- a/test/webcrypto/rsa.t.js
+++ b/test/webcrypto/rsa.t.mjs
@@ -99,7 +99,7 @@ function p(args, default_opts) {
 
 let rsa_tsuite = {
     name: "RSA-OAEP encoding/decoding",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/rsa_decoding.t.js b/test/webcrypto/rsa_decoding.t.mjs
similarity index 95%
rename from test/webcrypto/rsa_decoding.t.js
rename to test/webcrypto/rsa_decoding.t.mjs
index 3253daba..24733279 100644
--- a/test/webcrypto/rsa_decoding.t.js
+++ b/test/webcrypto/rsa_decoding.t.mjs
@@ -4,7 +4,7 @@ flags: [async]
 ---*/
 
 async function test(params) {
-    if (!has_fs() || !has_buffer() || !has_webcrypto()) {
+    if (!has_buffer() || !has_webcrypto()) {
         return 'SKIPPED';
     }
 
diff --git a/test/webcrypto/sign.t.js b/test/webcrypto/sign.t.mjs
similarity index 99%
rename from test/webcrypto/sign.t.js
rename to test/webcrypto/sign.t.mjs
index e35473c2..4fa78716 100644
--- a/test/webcrypto/sign.t.js
+++ b/test/webcrypto/sign.t.mjs
@@ -153,7 +153,7 @@ function p(args, default_opts) {
 
 let hmac_tsuite = {
     name: "HMAC sign",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -208,7 +208,7 @@ let hmac_tsuite = {
 
 let rsassa_pkcs1_v1_5_tsuite = {
     name: "RSASSA-PKCS1-v1_5 sign",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -354,7 +354,7 @@ let rsassa_pkcs1_v1_5_tsuite = {
 
 let rsa_pss_tsuite = {
     name: "RSA-PSS sign",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -397,7 +397,7 @@ let rsa_pss_tsuite = {
 
 let ecdsa_tsuite = {
     name: "ECDSA sign",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/webcrypto/verify.t.js b/test/webcrypto/verify.t.mjs
similarity index 95%
rename from test/webcrypto/verify.t.js
rename to test/webcrypto/verify.t.mjs
index df384724..70f608f3 100644
--- a/test/webcrypto/verify.t.js
+++ b/test/webcrypto/verify.t.mjs
@@ -53,7 +53,7 @@ function p(args, default_opts) {
 
 let hmac_tsuite = {
     name: "HMAC verify",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -78,7 +78,7 @@ let hmac_tsuite = {
 
 let rsassa_pkcs1_v1_5_tsuite = {
     name: "RSASSA-PKCS1-v1_5 verify",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -103,7 +103,7 @@ let rsassa_pkcs1_v1_5_tsuite = {
 
 let rsa_pss_tsuite = {
     name: "RSA-PSS verify",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
@@ -133,7 +133,7 @@ let rsa_pss_tsuite = {
 
 let ecdsa_tsuite = {
     name: "ECDSA verify",
-    skip: () => (!has_fs() || !has_buffer() || !has_webcrypto()),
+    skip: () => (!has_buffer() || !has_webcrypto()),
     T: test,
     prepare_args: p,
     opts: {
diff --git a/test/xml/saml_verify.t.js b/test/xml/saml_verify.t.mjs
similarity index 99%
rename from test/xml/saml_verify.t.js
rename to test/xml/saml_verify.t.mjs
index be6bae82..875fbd40 100644
--- a/test/xml/saml_verify.t.js
+++ b/test/xml/saml_verify.t.mjs
@@ -280,7 +280,7 @@ function p(args, default_opts) {
 
 let saml_verify_tsuite = {
     name: "SAML verify",
-    skip: () => (!has_njs() || !has_fs() || !has_webcrypto() || !has_xml()),
+    skip: () => (!has_njs() || !has_webcrypto() || !has_xml()),
     T: verify,
     prepare_args: p,
     opts: {


More information about the nginx-devel mailing list