This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proper clean up of fabricator children. fixes #254
- Loading branch information
1 parent
ca94640
commit fc7b6c1
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
const path = require('path'); | ||
const assert = require('assert'); | ||
const utils = require('../utils.js'); | ||
|
||
assert(!module.parent); | ||
assert(__dirname === process.cwd()); | ||
|
||
const target = process.argv[2] || 'host'; | ||
const input = './test-x-index.js'; | ||
const output = './test-output.exe'; | ||
|
||
let right; | ||
utils.mkdirp.sync(path.dirname(output)); | ||
|
||
// calling twice | ||
require('../../').exec([ | ||
'--target', target, | ||
'--output', output, input | ||
]).then(function () { | ||
return require('../../').exec([ | ||
'--target', target, | ||
'--output', output, input | ||
]).then(function () { | ||
right = utils.spawn.sync( | ||
output, [], {} | ||
); | ||
|
||
assert.equal(right, '42\n'); | ||
utils.vacuum.sync(output); | ||
}); | ||
}).catch(function (error) { | ||
console.error(error); | ||
process.exit(2); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
console.log(42); |