mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-18 17:17:57 +02:00
test: validate generated webpack config instead of compiling
This commit is contained in:
parent
1564edae4c
commit
3eb9823105
5 changed files with 121 additions and 69 deletions
21
test/webpack/dev.test.js
Normal file
21
test/webpack/dev.test.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import createDevConfig from '@lib/webpack/dev';
|
||||
import {validate} from 'webpack';
|
||||
import loadSetup from '../loadSetup';
|
||||
|
||||
describe('webpack dev config', () => {
|
||||
test('simple', async () => {
|
||||
console.log = jest.fn();
|
||||
const props = await loadSetup('simple');
|
||||
const config = createDevConfig(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 = createDevConfig(props).toConfig();
|
||||
const errors = validate(config);
|
||||
expect(errors.length).toBe(0);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue