mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-06 19:37:52 +02:00
* fix: #1114 static files in `blog/assets` is not working * lint fix
This commit is contained in:
parent
db6017903b
commit
a1e7af7e0e
6 changed files with 114 additions and 23 deletions
|
@ -14,6 +14,7 @@ const path = require('path');
|
|||
const fs = require('fs-extra');
|
||||
const docs = require('../docs');
|
||||
const metadataUtils = require('../metadataUtils');
|
||||
const {replaceAssetsLink} = require('../utils.js');
|
||||
|
||||
jest.mock('../env', () => ({
|
||||
translation: {
|
||||
|
@ -186,7 +187,7 @@ describe('getFile', () => {
|
|||
|
||||
describe('replaceAssetsLink', () => {
|
||||
test('transform document with valid assets link', () => {
|
||||
const content1 = docs.replaceAssetsLink(rawContent1);
|
||||
const content1 = replaceAssetsLink(rawContent1, 'docs');
|
||||
expect(content1).toMatchSnapshot();
|
||||
expect(content1).toContain('');
|
||||
expect(content1).toContain('');
|
||||
|
@ -200,7 +201,7 @@ describe('replaceAssetsLink', () => {
|
|||
});
|
||||
|
||||
test('does not transform document without valid assets link', () => {
|
||||
const content2 = docs.replaceAssetsLink(rawContent2);
|
||||
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