run file
commit8fade7fb756cadf98fecada83682d193716a78d0
authorAmjad Masad <amjad.masad@gmail.com>
dateSat 29 Aug 2020, 21:59 (6 years ago)
parent431724b
languages/nodejs/repl.js+2−1
@@ -1,3 +1,4 @@
1+const util = require('util');
12const repl = require("repl");
23const path = require("path");
34const fs = require("fs");
@@ -181,7 +182,7 @@ if (process.env.PRYBAR_CODE) {
181182 module.loaded = true;
182183
183184 if (typeof res !== "undefined") {
184− console.log(res);
185+ console.log(util.inspect(res, { colors: true }));
185186 }
186187 }
187188
tests/nodejs/run_file.exp+2−2
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/expect -d
22
33set timeout -1
44spawn ./prybar-nodejs -i ./test_files/hello.js
@@ -6,7 +6,7 @@ match_max 100000
66expect -exact "Node v12.18.3 on linux\r
77\u001b\[0m\u001b\[90mHint: hit control+c anytime to enter REPL.\[0m\r
88hello\r
9−hello\r
9+\u001b\[32m'hello'\u001b\[39m\r
1010\u001b\[1G\u001b\[0J--> \u001b\[5G"
1111send -- "a\r"
1212expect -exact "a\r\r