git ssb

0+

cel-desktop / ssb-pkg



Tree: d456a6cc8589489e558e6164750474ed2cfc961e

Files: d456a6cc8589489e558e6164750474ed2cfc961e / test / test-50-mountpoints / main.js

993 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5const fs = require('fs');
6const path = require('path');
7const assert = require('assert');
8const utils = require('../utils.js');
9
10assert(!module.parent);
11assert(__dirname === process.cwd());
12
13const target = process.argv[2] || 'host';
14const input = './test-x-index.js';
15const output = './run-time/test-output.exe';
16
17let right;
18utils.mkdirp.sync(path.dirname(output));
19utils.mkdirp.sync(path.join(path.dirname(output), 'plugins-D-ext'));
20
21fs.writeFileSync(
22 path.join(path.dirname(output), 'plugins-D-ext/test-y-require-D.js'),
23 fs.readFileSync('./plugins-D-ext/test-y-require-D.js')
24);
25
26utils.pkg.sync([
27 '--target', target,
28 '--output', output, input
29]);
30
31right = utils.spawn.sync(
32 './' + path.basename(output), [],
33 { cwd: path.dirname(output) }
34);
35
36assert.equal(right,
37 'I am C\n' +
38 'I am D\n' +
39 'test-x-index.js\n' +
40 'test-y-common.js\n' +
41 'plugins-C-int\n' +
42 'plugins-D-ext\n'
43);
44
45utils.vacuum.sync(path.dirname(output));
46

Built with git-ssb-web