Skip to content

Commit ac04940

Browse files
committed
Add tests
1 parent 122298b commit ac04940

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("./app.js")
2+
module.exports = "./app.js"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("./app/index.js")
2+
module.exports = "./app/index.js"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
require('../../../common');
4+
const assert = require('assert');
5+
const child_process = require('child_process');
6+
7+
async function spawnNodeRunner(path) {
8+
return new Promise((resolve, reject) => {
9+
child_process.exec(`node ${path}`, (err, stdout, stderr) => {
10+
if (err) {
11+
reject(err);
12+
} else {
13+
resolve(stdout);
14+
}
15+
});
16+
});
17+
};
18+
19+
async function main() {
20+
assert.strictEqual((await spawnNodeRunner('.')).trim(), require('.').trim());
21+
}
22+
23+
main();

0 commit comments

Comments
 (0)