git ssb

0+

cel-desktop / ssb-pkg



Tree: e9d9dec1d00ff365112ca0f981bbda15e3682528

Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / test / test-50-api / main.js

798 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 target = process.argv[2] || 'host';
13const input = './test-x-index.js';
14const output = './test-output.exe';
15
16let right;
17utils.mkdirp.sync(path.dirname(output));
18
19// calling twice
20require('../../').exec([
21 '--target', target,
22 '--output', output, input
23]).then(function () {
24 return require('../../').exec([
25 '--target', target,
26 '--output', output, input
27 ]).then(function () {
28 right = utils.spawn.sync(
29 output, [], {}
30 );
31
32 assert.equal(right, '42\n');
33 utils.vacuum.sync(output);
34 });
35}).catch(function (error) {
36 console.error(error);
37 process.exit(2);
38});
39

Built with git-ssb-web