fix: reload siteConfig.js automatically when locally served page is refreshed (#1509)

* fix: livereload siteConfig

* fix test

* nits
This commit is contained in:
Endi 2019-05-22 22:31:51 +07:00 committed by GitHub
parent aa157969cf
commit 166816af40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 53 additions and 42 deletions

View file

@ -71,6 +71,7 @@ describe('mdToHtmlify', () => {
const siteConfig = {
baseUrl: '/',
docsUrl: 'docs',
cleanUrl: true,
};
const mdToHtml = metadataUtils.mdToHtml(Metadata, siteConfig);
@ -79,6 +80,7 @@ describe('mdToHtmlify', () => {
rawContent1,
mdToHtml,
Metadata['en-doc1'],
siteConfig,
);
expect(content1).not.toContain('/docs/en/next/');
expect(content1).toMatchSnapshot();
@ -90,6 +92,7 @@ describe('mdToHtmlify', () => {
rawContent2,
mdToHtml,
Metadata['en-doc2'],
siteConfig,
);
expect(content2).toContain('/docs/en/next/');
expect(content2).toMatchSnapshot();
@ -111,6 +114,7 @@ describe('mdToHtmlify', () => {
rawContent3,
customMdToHtml,
customMetadata['subdir-doc3'],
siteConfig,
);
expect(content3).toContain('/docs/subdir/doc3');
expect(content3).not.toContain('subdir/doc3.md');
@ -123,6 +127,7 @@ describe('mdToHtmlify', () => {
rawContentRefLinks,
mdToHtml,
Metadata['en-reflinks'],
siteConfig,
);
expect(contentRefLinks).toContain('/docs/en/next/');
expect(contentRefLinks).toMatchSnapshot();