Files: d456a6cc8589489e558e6164750474ed2cfc961e / test / test-50-arguments / main.js
720 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 input = './test-x-index.js'; |
14 | const output = './test-output.exe'; |
15 | |
16 | let right; |
17 | utils.mkdirp.sync(path.dirname(output)); |
18 | |
19 | utils.pkg.sync([ |
20 | '--target', target, |
21 | '--output', output, input |
22 | ]); |
23 | |
24 | right = utils.spawn.sync(output, [ '42' ], {}); |
25 | assert.equal(right, '42\n'); |
26 | right = utils.spawn.sync(output, [ '-ft' ], {}); |
27 | assert.equal(right, '-ft\n'); |
28 | right = utils.spawn.sync(output, [ '--fourty-two' ], {}); |
29 | assert.equal(right, '--fourty-two\n'); |
30 | utils.vacuum.sync(output); |
31 |
Built with git-ssb-web