git ssb

0+

cel-desktop / ssb-pkg



Tree: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1

Files: 938b7ea4cfaa3cef6e1690b9ef3ea8bd7a0d2de1 / test / test-50-may-exclude-must-exclude / main.js

1979 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const assert = require('assert');
6const utils = require('../utils.js');
7
8assert(!module.parent);
9assert(__dirname === process.cwd());
10
11const target = process.argv[2] || 'host';
12const input = './test-x-index.js';
13const output = './test-output.exe';
14const standard = 'stdout';
15
16let right;
17
18const inspect = (standard === 'stdout')
19 ? [ 'inherit', 'pipe', 'inherit' ]
20 : [ 'inherit', 'inherit', 'pipe' ];
21
22right = utils.pkg.sync([
23 '--debug',
24 '--target', target,
25 '--output', output, input
26], inspect);
27
28assert(right.indexOf('\x1B\x5B') < 0, 'colors detected');
29
30right = 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
43assert.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
65utils.vacuum.sync(output);
66

Built with git-ssb-web