git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-signature / main.js

1403 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 = './test-output.exe';
16
17let right;
18
19utils.pkg.sync([
20 '--target', target,
21 '--output', output, input
22]);
23
24let spoiler = fs.readFileSync(output);
25spoiler = Buffer.concat([ spoiler, Buffer.from([
26 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
27 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
28 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
29 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
30 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
31 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
32 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
33 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
34 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
35 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
36 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
37 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xfe,
38 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
39 0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef ]) ]);
40fs.writeFileSync(output, spoiler);
41
42right = utils.spawn.sync(
43 './' + path.basename(output), [],
44 { cwd: path.dirname(output) }
45);
46
47assert.equal(right, 'ok\n');
48utils.vacuum.sync(output);
49

Built with git-ssb-web