Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Dec 25, 2021
1 parent 587df53 commit bcfc46d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import mdx from 'remark-mdx';
import vfile from 'to-vfile';
import plugin from '../index';
import headings from '../../headings/index';
import {escapePath} from '@docusaurus/utils';

const processFixture = async (name, options) => {
const filePath = path.join(__dirname, `__fixtures__/${name}.md`);
Expand All @@ -24,7 +23,8 @@ const processFixture = async (name, options) => {

return result
.toString()
.replace(new RegExp(escapePath(process.cwd()), 'g'), '[CWD]');
.replace(/\\\\/g, '/')
.replace(new RegExp(process.cwd().replace(/\\/g, '/'), 'g'), '[CWD]');
};

const staticDirs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import mdx from 'remark-mdx';
import vfile from 'to-vfile';
import plugin from '..';
import transformImage from '../../transformImage';
import {posixPath} from '@docusaurus/utils';

const processFixture = async (name: string, options?) => {
const filePath = path.join(__dirname, `__fixtures__/${name}.md`);
Expand All @@ -33,7 +32,8 @@ const processFixture = async (name: string, options?) => {

return result
.toString()
.replace(new RegExp(posixPath(process.cwd()), 'g'), '[CWD]');
.replace(/\\\\/g, '/')
.replace(new RegExp(process.cwd().replace(/\\/g, '/'), 'g'), '[CWD]');
};

describe('transformAsset plugin', () => {
Expand Down

0 comments on commit bcfc46d

Please sign in to comment.