git ssb

0+

cel-desktop / ssb-pkg



Tree: 1eb144e388da5f1a3466703f56ac4ab591d700fc

Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-50-invalid-package-json-bin / main.js

686 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 standard = 'stdout';
13
14let right;
15
16const inspect = (standard === 'stdout')
17 ? [ 'inherit', 'pipe', 'inherit' ]
18 : [ 'inherit', 'inherit', 'pipe' ];
19
20right = utils.pkg.sync([
21 '--target', target,
22 '--output', 'no-output', '.'
23], { stdio: inspect, expect: 2 });
24
25assert(right.indexOf('\x1B\x5B') < 0, 'colors detected');
26assert(right.indexOf('Error!') >= 0);
27assert(right.indexOf('Property \'bin\' does not exist') >= 0);
28assert(right.indexOf('package.json') >= 0);
29

Built with git-ssb-web