Files: 67c0e15a98a66eb99db2251478505d6f3d37535c / test / test-50-mountpoints / main.js
993 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const fs = require('fs'); |
6 | const path = require('path'); |
7 | const assert = require('assert'); |
8 | const utils = require('../utils.js'); |
9 | |
10 | assert(!module.parent); |
11 | assert(__dirname === process.cwd()); |
12 | |
13 | const target = process.argv[2] || 'host'; |
14 | const input = './test-x-index.js'; |
15 | const output = './run-time/test-output.exe'; |
16 | |
17 | let right; |
18 | utils.mkdirp.sync(path.dirname(output)); |
19 | utils.mkdirp.sync(path.join(path.dirname(output), 'plugins-D-ext')); |
20 | |
21 | fs.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 | |
26 | utils.pkg.sync([ |
27 | '--target', target, |
28 | '--output', output, input |
29 | ]); |
30 | |
31 | right = utils.spawn.sync( |
32 | './' + path.basename(output), [], |
33 | { cwd: path.dirname(output) } |
34 | ); |
35 | |
36 | assert.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 | |
45 | utils.vacuum.sync(path.dirname(output)); |
46 |
Built with git-ssb-web