Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-50-invalid-package-json / main.js
669 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const assert = require('assert'); |
6 | const utils = require('../utils.js'); |
7 | |
8 | assert(!module.parent); |
9 | assert(__dirname === process.cwd()); |
10 | |
11 | const target = process.argv[2] || 'host'; |
12 | const standard = 'stdout'; |
13 | |
14 | let right; |
15 | |
16 | const inspect = (standard === 'stdout') |
17 | ? [ 'inherit', 'pipe', 'inherit' ] |
18 | : [ 'inherit', 'inherit', 'pipe' ]; |
19 | |
20 | right = utils.pkg.sync([ |
21 | '--target', target, |
22 | '--output', 'no-output', '.' |
23 | ], { stdio: inspect, expect: 2 }); |
24 | |
25 | assert(right.indexOf('\x1B\x5B') < 0, 'colors detected'); |
26 | assert(right.indexOf('Error!') >= 0); |
27 | assert(right.indexOf('does not exist') >= 0); |
28 | assert(right.indexOf('package.json') >= 0); |
29 |
Built with git-ssb-web