mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 17:47:40 +02:00
fix: do not hardcode siteConfig path (#1150)
* Fix broken build Do not hardcode path in require to siteConfig * Just require instead of loadConfig * Actually use loadConfig I think the test may be wrong too. * refactor & nits * jest mock to fix test * fix test
This commit is contained in:
parent
71824a3541
commit
c78a8b4262
5 changed files with 19 additions and 11 deletions
|
@ -10,6 +10,7 @@ const originalCwd = process.cwd();
|
|||
if (!/website$/.test(originalCwd)) {
|
||||
process.chdir(process.cwd() + '/website');
|
||||
}
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const docs = require('../docs');
|
||||
|
@ -187,7 +188,7 @@ describe('getFile', () => {
|
|||
|
||||
describe('replaceAssetsLink', () => {
|
||||
test('transform document with valid assets link', () => {
|
||||
const content1 = replaceAssetsLink(rawContent1, 'docs');
|
||||
const content1 = replaceAssetsLink(rawContent1, '/docs');
|
||||
expect(content1).toMatchSnapshot();
|
||||
expect(content1).toContain('');
|
||||
expect(content1).toContain('');
|
||||
|
@ -201,7 +202,7 @@ describe('replaceAssetsLink', () => {
|
|||
});
|
||||
|
||||
test('does not transform document without valid assets link', () => {
|
||||
const content2 = replaceAssetsLink(rawContent2, 'docs');
|
||||
const content2 = replaceAssetsLink(rawContent2, '/docs');
|
||||
expect(content2).toMatchSnapshot();
|
||||
expect(content2).not.toContain('');
|
||||
expect(content2).not.toContain('');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue