Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-50-promisify / main.js
710 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const path = require('path'); |
6 | const assert = require('assert'); |
7 | const utils = require('../utils.js'); |
8 | |
9 | assert(!module.parent); |
10 | assert(__dirname === process.cwd()); |
11 | |
12 | const host = 'node' + process.version.match(/^v(\d+)/)[1]; |
13 | const target = process.argv[2] || host; |
14 | const input = './test-x-index.js'; |
15 | const output = './test-output.exe'; |
16 | |
17 | let left, right; |
18 | |
19 | left = utils.spawn.sync( |
20 | 'node', [ path.basename(input) ], |
21 | { cwd: path.dirname(input) } |
22 | ); |
23 | |
24 | utils.pkg.sync([ |
25 | '--target', target, |
26 | '--output', output, input |
27 | ]); |
28 | |
29 | right = utils.spawn.sync( |
30 | './' + path.basename(output), [], |
31 | { cwd: path.dirname(output) } |
32 | ); |
33 | |
34 | assert.equal(left, right); |
35 | utils.vacuum.sync(output); |
36 |
Built with git-ssb-web