Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-chdir-env-var / main.js
658 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 = './run-time/test-output.exe'; |
15 | |
16 | let right; |
17 | |
18 | utils.pkg.sync([ |
19 | '--target', target, |
20 | '--output', output, input |
21 | ], { env: { |
22 | CHDIR: 'source', |
23 | PATH: process.env.PATH |
24 | } }); |
25 | |
26 | right = utils.spawn.sync( |
27 | './' + path.basename(output), [], |
28 | { cwd: path.dirname('source/' + output) } |
29 | ); |
30 | |
31 | assert.equal(right, 'ok\n'); |
32 | utils.vacuum.sync(path.dirname('source/' + output)); |
33 |
Built with git-ssb-web