Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jun 1, 2019
1 parent a43cf7f commit 3732dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
2 changes: 1 addition & 1 deletion test/cli.test.js
Expand Up @@ -100,7 +100,7 @@ describe('CLI', () => {
.catch(done);
});

it.skip('should accept the promise function of webpack.config.js', (done) => {
it('should accept the promise function of webpack.config.js', (done) => {
testBin(
false,
resolve(__dirname, 'fixtures/promise-config/webpack.config.js')
Expand Down
29 changes: 1 addition & 28 deletions test/helpers/test-bin.js
Expand Up @@ -30,34 +30,7 @@ function testBin(testArgs, configPath) {

const args = [webpackDevServerPath, '--config', configPath].concat(testArgs);

return new Promise((resolve, reject) => {
const child = execa('node', args, { cwd, env });

child.on('error', (error) => reject(error));

child.stdout.on('data', (data) => {
const str = data.toString();

stdout += str;

console.log('=-=', str);
// if webpack.config.js is a promise function, it won't be able to call `close`
// if (str.includes('Compiled successfully.')) {
// child.kill('SIGINT');
// }
});

child.stderr.on('data', (data) => {
stderr += data.toString();
});

child.on('close', (code) => {
if (code !== 0) {
return reject(stderr);
}
resolve({ stdout, stderr, code });
});
});
return execa('node', args, { cwd, env, timeout: 2000 });
}

module.exports = testBin;

0 comments on commit 3732dd0

Please sign in to comment.