Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-50-invalid-package-json-2 / main.js
808 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const assert = require('assert'); |
6 | const path = require('path'); |
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 | const standard = 'stdout'; |
16 | |
17 | let right; |
18 | |
19 | const inspect = (standard === 'stdout') |
20 | ? [ 'inherit', 'pipe', 'inherit' ] |
21 | : [ 'inherit', 'inherit', 'pipe' ]; |
22 | |
23 | right = utils.pkg.sync([ |
24 | '--target', target, |
25 | '--output', output, input |
26 | ], inspect); |
27 | |
28 | assert(right.indexOf('\x1B\x5B') < 0, 'colors detected'); |
29 | assert(right.indexOf('Warning') >= 0); |
30 | assert(right.indexOf('Entry \'main\' not found') >= 0); |
31 | assert(right.indexOf('crusader' + path.sep + 'package.json') >= 0); |
32 | |
33 | utils.vacuum.sync(output); |
34 |
Built with git-ssb-web