Created
July 31, 2018 02:47
-
-
Save rubys/b79c692831b2a9a6dea4897c3d121f7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
require('../common'); | |
const assert = require('assert'); | |
const { spawn } = require('child_process'); | |
const input = ` | |
import('path').then( | |
(path) => {process.stdout.write(path.delimiter)}, | |
console.log | |
); | |
`.trim(); | |
const node = process.argv[0]; | |
const args = ['--experimental-modules']; | |
const subprocess = spawn(node, args); | |
let stdout = ''; | |
let stderr = ''; | |
subprocess.stdin.end(input); | |
subprocess.stdout.on('data', (data) => stdout += data); | |
subprocess.stderr.on('data', (data) => stderr += data); | |
subprocess.on('close', () => { | |
assert.strictEqual(stderr.replace(/.*ExperimentalWarning.*/, '').trim(), ''); | |
assert.strictEqual(stdout.trim(), ':'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment