mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
test: compile webpack config for dev and prod
This commit is contained in:
parent
a4f0ed7c94
commit
f07e7791fa
5 changed files with 72 additions and 48 deletions
29
test/webpack/base.test.js
Normal file
29
test/webpack/base.test.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
import createDevConfig from '@lib/webpack/dev';
|
||||
import compile from './compile';
|
||||
import loadSetup from '../loadSetup';
|
||||
|
||||
describe('webpack dev config', () => {
|
||||
const timeOut = 20000; // 20 seconds
|
||||
|
||||
test(
|
||||
'simple',
|
||||
async () => {
|
||||
console.log = jest.fn();
|
||||
const props = await loadSetup('simple');
|
||||
const config = createDevConfig(props).toConfig();
|
||||
return expect(compile(config)).resolves.toBe('Compiled successfully');
|
||||
},
|
||||
timeOut
|
||||
);
|
||||
|
||||
test(
|
||||
'custom',
|
||||
async () => {
|
||||
console.log = jest.fn();
|
||||
const props = await loadSetup('custom');
|
||||
const config = createDevConfig(props).toConfig();
|
||||
return expect(compile(config)).resolves.toBe('Compiled successfully');
|
||||
},
|
||||
timeOut
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue