From: Dmitry Volyntsev Date: Thu, 8 Feb 2024 01:57:01 +0000 (-0800) Subject: Test262: simplified import_chain.t.js. X-Git-Tag: 0.8.4~30 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=88691d82dc98852aa203028c1a3ab5cb929ab6db;p=njs.git Test262: simplified import_chain.t.js. Avoid using "crypto" module, which unnessesary complicates the test. --- diff --git a/test/js/import_chain.t.js b/test/js/import_chain.t.js index 8efb6c39..467a3340 100644 --- a/test/js/import_chain.t.js +++ b/test/js/import_chain.t.js @@ -4,10 +4,6 @@ flags: [] paths: [test/js/module/, test/js/module/libs/, test/js/module/sub] ---*/ -import lib2 from 'lib2.js'; +import lib2 from 'lib2.js'; -import crypto from 'crypto'; -var h = crypto.createHash('md5'); -var hash = h.update('AB').digest('hex'); - -assert.sameValue(lib2.hash(), hash); +assert.sameValue(lib2.hash(), "XXX"); diff --git a/test/js/module/libs/hash.js b/test/js/module/libs/hash.js index 2eb3728c..6d6c6917 100644 --- a/test/js/module/libs/hash.js +++ b/test/js/module/libs/hash.js @@ -1,11 +1,8 @@ function hash() { - var h = crypto.createHash('md5'); - var v = h.update('AB').digest('hex'); - return v; + return "XXX"; } import sub from 'sub/sub3.js'; import name from 'name.js'; -import crypto from 'crypto'; export default {hash, name}; diff --git a/test/js/module/sub/sub1.js b/test/js/module/sub/sub1.js index 1b880a6f..3b188ade 100644 --- a/test/js/module/sub/sub1.js +++ b/test/js/module/sub/sub1.js @@ -1,5 +1,5 @@ function hash() { - return sub2.hash(crypto); + return sub2.hash(); } function error() { @@ -7,6 +7,5 @@ function error() { } import sub2 from 'sub2.js'; -import crypto from 'crypto'; export default {hash, error};