Tests: added tests for NJS loadable modules.
This commit is contained in:
3
test/njs/global_this/script.js
Normal file
3
test/njs/global_this/script.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
"str" : function () {return typeof globalThis.njs.version}
|
||||
}
|
||||
5
test/njs/import_from/script.js
Normal file
5
test/njs/import_from/script.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import cr from 'crypto';
|
||||
|
||||
export default {
|
||||
"num" : function () {return typeof cr.createHash('md5').digest().length}
|
||||
}
|
||||
3
test/njs/invalid/script.js
Normal file
3
test/njs/invalid/script.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
"route": function() {blah 'next'}
|
||||
}
|
||||
3
test/njs/next/script.js
Normal file
3
test/njs/next/script.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
"route": function() {return 'next'}
|
||||
}
|
||||
Reference in New Issue
Block a user