Files: cfc8d49135488f7554210234b3a503c2dbd6c6a5 / test / test-50-odd-entrypoint / main.js
878 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 target = process.argv[2] || 'host'; |
13 | const windows = process.platform === 'win32'; |
14 | let input = './test-x-index.js'; |
15 | const output = './run-time/test-output.exe'; |
16 | |
17 | if (windows) { |
18 | input = path.resolve(input).toLowerCase(); |
19 | } else { |
20 | // did not manage to find odd one for unix |
21 | } |
22 | |
23 | let left, right; |
24 | utils.mkdirp.sync(path.dirname(output)); |
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(path.dirname(output)); |
43 |
Built with git-ssb-web