Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-may-exclude-must-exclude / main.js
1979 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 input = './test-x-index.js'; |
13 | const output = './test-output.exe'; |
14 | const standard = 'stdout'; |
15 | |
16 | let right; |
17 | |
18 | const inspect = (standard === 'stdout') |
19 | ? [ 'inherit', 'pipe', 'inherit' ] |
20 | : [ 'inherit', 'inherit', 'pipe' ]; |
21 | |
22 | right = utils.pkg.sync([ |
23 | '--debug', |
24 | '--target', target, |
25 | '--output', output, input |
26 | ], inspect); |
27 | |
28 | assert(right.indexOf('\x1B\x5B') < 0, 'colors detected'); |
29 | |
30 | right = right.split('\n').filter(function (line) { |
31 | return (line.indexOf(' [debug] ') >= 0) || |
32 | (line.indexOf(' Warning ') >= 0); |
33 | }).filter(function (line) { |
34 | return (line.indexOf('Targets:') < 0) && |
35 | (line.indexOf('added to queue') < 0) && |
36 | (line.indexOf('was included') < 0); |
37 | }).map(function (line) { |
38 | if (line.indexOf('Cannot find module') >= 0) { |
39 | return line.split(' from ')[0]; |
40 | } else return line; |
41 | }).join('\n') + '\n'; |
42 | |
43 | assert.deepEqual(right.split('\n').slice(0, 16), [ |
44 | '> Warning Cannot resolve \'reqResSomeVar\'', |
45 | '> [debug] Cannot resolve \'reqResSomeVarMay\'', |
46 | '> Warning Malformed requirement for \'reqResSomeVar\'', |
47 | '> Warning Malformed requirement for \'reqResSomeVar\'', |
48 | |
49 | '> Warning Cannot resolve \'reqSomeVar\'', |
50 | '> [debug] Cannot resolve \'reqSomeVarMay\'', |
51 | '> Warning Malformed requirement for \'reqSomeVar\'', |
52 | '> Warning Malformed requirement for \'reqSomeVar\'', |
53 | |
54 | '> [debug] Cannot resolve \'tryReqResSomeVar\'', |
55 | '> [debug] Cannot resolve \'tryReqResSomeVarMay\'', |
56 | '> [debug] Cannot resolve \'tryReqSomeVar\'', |
57 | '> [debug] Cannot resolve \'tryReqSomeVarMay\'', |
58 | |
59 | '> [debug] Cannot find module \'reqResSomeLit\'', |
60 | '> [debug] Cannot find module \'reqResSomeLitMay\'', |
61 | '> [debug] Cannot find module \'reqSomeLit\'', |
62 | '> [debug] Cannot find module \'reqSomeLitMay\'' |
63 | ]); |
64 | |
65 | utils.vacuum.sync(output); |
66 |
Built with git-ssb-web