mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-25 12:38:57 +02:00
feat: add siteConfig loader
This commit is contained in:
parent
06faff3474
commit
94c45e36cb
11 changed files with 4726 additions and 51 deletions
28
test/loader/config.test.js
Normal file
28
test/loader/config.test.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const loadConfig = require('../../lib/loader/config');
|
||||
|
||||
describe('loadConfig', () => {
|
||||
const simpleDir = path.join(__dirname, '__fixtures__', 'simple');
|
||||
const customDir = path.join(__dirname, '__fixtures__', 'custom');
|
||||
|
||||
test('simple', () => {
|
||||
expect(loadConfig(simpleDir)).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"description": "Hello World",
|
||||
"title": "Hello World",
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('custom', () => {
|
||||
expect(loadConfig(customDir)).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"base": "blogi",
|
||||
"description": "Hello World",
|
||||
"dest": "blogi",
|
||||
"title": "Hello World",
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue