Skip to content

Commit 3732dd0

Browse files
committed
chore: wip
1 parent a43cf7f commit 3732dd0

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

test/cli.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('CLI', () => {
100100
.catch(done);
101101
});
102102

103-
it.skip('should accept the promise function of webpack.config.js', (done) => {
103+
it('should accept the promise function of webpack.config.js', (done) => {
104104
testBin(
105105
false,
106106
resolve(__dirname, 'fixtures/promise-config/webpack.config.js')

test/helpers/test-bin.js

+1-28
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,7 @@ function testBin(testArgs, configPath) {
3030

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

33-
return new Promise((resolve, reject) => {
34-
const child = execa('node', args, { cwd, env });
35-
36-
child.on('error', (error) => reject(error));
37-
38-
child.stdout.on('data', (data) => {
39-
const str = data.toString();
40-
41-
stdout += str;
42-
43-
console.log('=-=', str);
44-
// if webpack.config.js is a promise function, it won't be able to call `close`
45-
// if (str.includes('Compiled successfully.')) {
46-
// child.kill('SIGINT');
47-
// }
48-
});
49-
50-
child.stderr.on('data', (data) => {
51-
stderr += data.toString();
52-
});
53-
54-
child.on('close', (code) => {
55-
if (code !== 0) {
56-
return reject(stderr);
57-
}
58-
resolve({ stdout, stderr, code });
59-
});
60-
});
33+
return execa('node', args, { cwd, env, timeout: 2000 });
6134
}
6235

6336
module.exports = testBin;

0 commit comments

Comments
 (0)