Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-for-await-of / main.js
782 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | const path = require('path'); |
6 | const assert = require('assert'); |
7 | const utils = require('../utils.js'); |
8 | |
9 | assert(!module.parent); |
10 | assert(__dirname === process.cwd()); |
11 | |
12 | const host = 'node' + process.version.match(/^v(\d+)/)[1]; |
13 | const target = process.argv[2] || host; |
14 | const input = './test-x-index.js'; |
15 | const output = './test-output.exe'; |
16 | |
17 | if (/^(node|v)?0/.test(target)) return; |
18 | if (/^(node|v)?4/.test(target)) return; |
19 | if (/^(node|v)?6/.test(target)) return; |
20 | if (/^(node|v)?8/.test(target)) return; |
21 | |
22 | let right; |
23 | |
24 | utils.pkg.sync([ |
25 | '--target', target, |
26 | '--output', output, input |
27 | ]); |
28 | |
29 | right = utils.spawn.sync( |
30 | './' + path.basename(output), [], |
31 | { cwd: path.dirname(output) } |
32 | ); |
33 | |
34 | assert.equal(right, '1\n2\n3\n4\n5\n'); |
35 | utils.vacuum.sync(output); |
36 |
Built with git-ssb-web