test: update test webpack

This commit is contained in:
endiliey 2018-08-26 03:15:25 +08:00
parent be3d259ac8
commit 3530cbe173
3 changed files with 98 additions and 66 deletions

View file

@ -0,0 +1,21 @@
import createServerConfig from '@lib/webpack/server';
import {validate} from 'webpack';
import loadSetup from '../loadSetup';
describe('webpack production config', () => {
test('simple', async () => {
console.log = jest.fn();
const props = await loadSetup('simple');
const config = createServerConfig(props).toConfig();
const errors = validate(config);
expect(errors.length).toBe(0);
});
test('custom', async () => {
console.log = jest.fn();
const props = await loadSetup('custom');
const config = createServerConfig(props).toConfig();
const errors = validate(config);
expect(errors.length).toBe(0);
});
});