Skip to content

Commit 952bf83

Browse files
committed
debug
1 parent 1d3a764 commit 952bf83

File tree

3 files changed

+25
-31
lines changed

3 files changed

+25
-31
lines changed

test/bin/encore.test.js

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -308,27 +308,18 @@ module.exports = Encore.getWebpackConfig();
308308
);
309309

310310
const binPath = path.resolve(projectDir, 'bin', 'encore.js');
311-
try {
312-
await execAsync(`node ${binPath} dev-server --context=${testDir}`, {
313-
cwd: testDir,
314-
env: Object.assign({}, process.env, { NO_COLOR: 'true' })
315-
});
316-
317-
throw new Error('Expected command to fail.');
318-
} catch (err) {
319-
console.log({ err })
320-
if (!'stdout' in err || !'stderr' in err) {
321-
throw new Error(`Error executing encore: ${err}`);
322-
}
311+
const { stdout, stderr } = await execAsync(`node ${binPath} dev-server --context=${testDir}`, {
312+
cwd: testDir,
313+
env: Object.assign({}, process.env, { NO_COLOR: 'true' })
314+
});
323315

324-
expect(err.stdout).to.contain('Install webpack-dev-server to use the webpack Development Server');
325-
expect(err.stdout).to.contain('npm install webpack-dev-server --save-dev');
326-
expect(err.stderr).to.equal('');
316+
expect(stdout).to.contain('Install webpack-dev-server to use the webpack Development Server');
317+
expect(stdout).to.contain('npm install webpack-dev-server --save-dev');
318+
expect(stderr).to.equal('');
327319

328-
expect(err.stdout).not.to.contain('Running webpack-dev-server ...');
329-
expect(err.stdout).not.to.contain('Compiled successfully in');
330-
expect(err.stdout).not.to.contain('webpack compiled successfully');
331-
}
320+
expect(stdout).not.to.contain('Running webpack-dev-server ...');
321+
expect(stdout).not.to.contain('Compiled successfully in');
322+
expect(stdout).not.to.contain('webpack compiled successfully');
332323
});
333324
});
334325
});

test/config-generator.test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -965,14 +965,16 @@ describe('The config-generator function', () => {
965965
});
966966

967967
describe('Test shouldSplitEntryChunks', () => {
968-
const config = createConfig();
969-
config.outputPath = '/tmp/public/build';
970-
config.setPublicPath('/build/');
971-
config.splitEntryChunks();
972-
973-
const actualConfig = configGenerator(config);
974-
expect(actualConfig.optimization.splitChunks.chunks).to.equal('all');
975-
expect(actualConfig.optimization.splitChunks.name).to.be.undefined;
968+
it('with defaults', () => {
969+
const config = createConfig();
970+
config.outputPath = '/tmp/public/build';
971+
config.setPublicPath('/build/');
972+
config.splitEntryChunks();
973+
974+
const actualConfig = configGenerator(config);
975+
expect(actualConfig.optimization.splitChunks.chunks).to.equal('all');
976+
expect(actualConfig.optimization.splitChunks.name).to.be.undefined;
977+
})
976978
});
977979

978980
describe('Test shouldUseSingleRuntimeChunk', () => {

test/functional.test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ describe('Functional tests using webpack', { timeout: 10000}, function() {
7777
let browser;
7878

7979
beforeAll(async () => {
80+
console.log('beforeAll', puppeteer);
8081
browser = await puppeteer.launch()
81-
});
8282

83-
afterAll(async() => {
84-
await browser.close()
83+
return async() => {
84+
console.log('closeBrowser', browser);
85+
await browser.close();
86+
}
8587
});
8688

8789
describe('Basic scenarios.', () => {
@@ -1393,7 +1395,6 @@ module.exports = {
13931395
});
13941396

13951397
it('TypeScript is compiled and type checking is done in a separate process!', (done) => {
1396-
this.timeout(10000);
13971398
setTimeout(done, 9000);
13981399

13991400
const config = createWebpackConfig('www/build', 'dev');

0 commit comments

Comments
 (0)