git ssb

0+

cel-desktop / ssb-pkg



Tree: 8f4b43a09aab9801bf28987edd59c2e366180327

Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / test / test-50-error-source-position / main.js

843 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
17let right;
18
19utils.pkg.sync([
20 '--public',
21 '--target', target,
22 '--output', output, input
23]);
24
25right = utils.spawn.sync(
26 './' + path.basename(output), [],
27 { cwd: path.dirname(output),
28 stdio: 'pipe', expect: 1 }
29);
30
31if (!(/^(node|v)?0/.test(target))) {
32 assert(right.stderr.indexOf('x.parse is not a function') >= 0);
33}
34
35const errorPointer = 'x.parse();' + require('os').EOL + ' ^';
36assert(right.stderr.indexOf(errorPointer) >= 0);
37utils.vacuum.sync(output);
38

Built with git-ssb-web