Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-many-arrow-functions / main.js
961 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 | const arch = process.arch; // TODO extract arch from `target` once it contains |
18 | if (arch === 'arm') return; |
19 | const version1 = process.version; |
20 | if (/^(node|v)?0/.test(version1)) return; |
21 | const version2 = target; |
22 | if (/^(node|v)?0/.test(version2)) return; |
23 | |
24 | let left, right; |
25 | |
26 | left = utils.spawn.sync( |
27 | 'node', [ path.basename(input) ], |
28 | { cwd: path.dirname(input) } |
29 | ); |
30 | |
31 | utils.pkg.sync([ |
32 | '--target', target, |
33 | '--output', output, input |
34 | ]); |
35 | |
36 | right = utils.spawn.sync( |
37 | './' + path.basename(output), [], |
38 | { cwd: path.dirname(output) } |
39 | ); |
40 | |
41 | assert.equal(left, right); |
42 | utils.vacuum.sync(output); |
43 |
Built with git-ssb-web