git ssb

0+

cel-desktop / ssb-pkg



Tree: efcf9fd06b02fa9bcd28681b4c777224e19702bb

Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-50-public-packages / main.js

837 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const path = require('path');
6const assert = require('assert');
7const utils = require('../utils.js');
8
9assert(!module.parent);
10assert(__dirname === process.cwd());
11
12const host = 'node' + process.version.match(/^v(\d+)/)[1];
13const target = process.argv[2] || host;
14const input = './test-x-index.js';
15const output = './test-output.exe';
16
17if (/^(node|v)?0/.test(target)) return;
18
19for (const pub of [ 'swordsman', 'crusader', '*' ]) {
20 let right;
21
22 utils.pkg.sync([
23 '--public-packages=' + pub,
24 '--target', target,
25 '--output', output, input
26 ]);
27
28 right = utils.spawn.sync(
29 './' + path.basename(output), [],
30 { cwd: path.dirname(output) }
31 );
32
33 if (pub === 'swordsman') {
34 assert.equal(right, '');
35 } else {
36 assert.equal(right, 'ok\n');
37 }
38
39 utils.vacuum.sync(output);
40}
41

Built with git-ssb-web