on master help sign in
Add test for modules
commit2a2fe5a1b08beaf73653a5aad2b01fe964f9502b authormasad-frost <farismasad@gmail.com> dateWed 20 Jan 2021, 15:57 (6 years ago) parent303bb66
2 files changed+17
test_files/module_patching.js+7 tests/nodejs/module_patching.exp+10
test_files/module_patching.jsnew file+7
@@ -0,0 +1,7 @@
1+console.assert(module.id === '.')
2+console.assert(Object.keys(module.exports).length === 0)
3+console.assert(module.parent === null)
4+console.assert(module.loaded === false)
5+console.assert(module.children.length === 0)
6+console.assert(module.filename === __filename)
7+console.assert(module.filename.endsWith('/test_files/module_patching.js'));
tests/nodejs/module_patching.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i ./test_files/global_bug.js
5+match_max 100000
6+expect -re {Node v\d+\.\d+.\d+ on linux}
7+expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
8+\[1G\[0J--> \[5G"
9+send -- ""
10+expect eof