]> git.kaiwu.me - njs.git/commitdiff
Test262: simplified import_chain.t.js.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 8 Feb 2024 01:57:01 +0000 (17:57 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 8 Feb 2024 01:57:01 +0000 (17:57 -0800)
Avoid using "crypto" module, which unnessesary complicates the test.

test/js/import_chain.t.js
test/js/module/libs/hash.js
test/js/module/sub/sub1.js

index 8efb6c39b59ffb593c59c77f65ccc0db97ad137c..467a3340b8c6e6515f80196e442eba6c88990954 100644 (file)
@@ -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");
index 2eb3728cfaaab138e947c369835e16e6ebee31dc..6d6c69172ab34af68d5e1dd8c8a484a5ccfd8478 100644 (file)
@@ -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};
index 1b880a6f797ea487f6a5b49824cc82cd7fbc8264..3b188ade72661e09c170fdb4fc71e013826eee74 100644 (file)
@@ -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};