Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / test / test-50-reject-4 / main.js
925 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 | // only linux has node4 |
13 | if (process.platform !== 'linux') return; |
14 | |
15 | const target = 'node4'; |
16 | const inputs = { index: './test-x-index.js', warmup: './test-x-warmup.js' }; |
17 | const output = './run-time/test-output.exe'; |
18 | |
19 | utils.mkdirp.sync(path.dirname(output)); |
20 | |
21 | utils.pkg.sync([ |
22 | '--target', target, |
23 | '--output', output, inputs.warmup // fetch this particular node version |
24 | ], { stdio: [ 'inherit', 'inherit', 'pipe' ] }); |
25 | |
26 | let right = utils.pkg.sync([ |
27 | '--target', target, |
28 | '--output', output, inputs.index |
29 | ], { stdio: 'pipe' }); |
30 | |
31 | assert(right.stdout.indexOf('\x1B\x5B') < 0, 'colors detected'); |
32 | assert(right.stdout.indexOf('Warning') >= 0); |
33 | assert(right.stdout.indexOf(target) >= 0); |
34 | utils.vacuum.sync(path.dirname(output)); |
35 |
Built with git-ssb-web