Skip to content

Commit

Permalink
test: update
Browse files Browse the repository at this point in the history
  • Loading branch information
anshumanv committed Mar 27, 2021
1 parent c6134cd commit cfccfa9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/build/start-finish-force-log/start-finish-force-log.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { run, runWatch } = require('../../utils/test-utils');
const { run, runWatch, isWebpack5 } = require('../../utils/test-utils');

describe('start finish force log', () => {
it('start finish force log when env is set', () => {
Expand All @@ -10,7 +10,8 @@ describe('start finish force log', () => {
expect(exitCode).toBe(0);
expect(stderr).toContain('Compiler starting...');
expect(stderr).toContain('Compiler finished');
expect(stdout).toBeTruthy();
const output = isWebpack5 ? 'compiled successfully' : 'main.js';
expect(stdout).toContain(output);
});

it('should show name of the config', () => {
Expand All @@ -20,7 +21,8 @@ describe('start finish force log', () => {
expect(exitCode).toBe(0);
expect(stderr).toContain("Compiler 'log config' starting...");
expect(stderr).toContain("Compiler 'log config' finished");
expect(stdout).toBeTruthy();
const output = isWebpack5 ? 'compiled successfully' : 'main.js';
expect(stdout).toContain(output);
});

it('should work with watch', async () => {
Expand All @@ -29,7 +31,8 @@ describe('start finish force log', () => {
});
expect(stderr).toContain('Compiler starting...');
expect(stderr).toContain('Compiler finished');
expect(stdout).toBeTruthy();
const output = isWebpack5 ? 'compiled successfully' : 'main.js';
expect(stdout).toContain(output);
});

it('should work with multi compiler', () => {
Expand All @@ -41,6 +44,7 @@ describe('start finish force log', () => {
expect(stderr).toContain("Compiler 'Satoru' starting...");
expect(stderr).toContain("Compiler 'Gojou' finished");
expect(stderr).toContain("Compiler 'Satoru' finished");
expect(stdout).toBeTruthy();
const output = isWebpack5 ? 'compiled successfully' : 'main.js';
expect(stdout).toContain(output);
});
});

0 comments on commit cfccfa9

Please sign in to comment.