Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-reject-6 / main.js
970 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 and alpine have node6 |
13 | if (process.platform !== 'linux' && process.platform !== 'alpine') return; |
14 | |
15 | const target = 'node6'; |
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