Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-78-verify-pkg-version / main.js
668 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 left, right; |
17 | |
18 | left = require('../../package.json').version; |
19 | |
20 | utils.pkg.sync([ |
21 | '--target', target, |
22 | '--output', output, input |
23 | ]); |
24 | |
25 | right = utils.spawn.sync( |
26 | './' + path.basename(output), [], |
27 | { cwd: path.dirname(output) } |
28 | ); |
29 | |
30 | assert.equal(left[0], '4'); |
31 | assert.equal(right[0], '4'); |
32 | assert.equal(left + '\n', right); |
33 | utils.vacuum.sync(output); |
34 |
Built with git-ssb-web