chore: disable string escaping in snapshots (#7131)

This commit is contained in:
Joshua Chen 2022-04-08 11:23:19 +08:00 committed by GitHub
parent 4134ebb3fb
commit 9145ae88cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 1881 additions and 1884 deletions

View file

@ -10,6 +10,7 @@
import _ from 'lodash';
import {escapePath} from '@docusaurus/utils';
import stripAnsi from 'strip-ansi';
import {version} from '@docusaurus/core/package.json';
import os from 'os';
import path from 'path';
@ -76,6 +77,7 @@ function normalizePaths<T>(value: T): T {
const homeRealRelativeToTemp = path.relative(tempDir, homeDirReal);
const runner: ((val: string) => string)[] = [
(val) => (val.includes('keepAnsi') ? val : stripAnsi(val)),
// Replace process.cwd with <PROJECT_ROOT>
(val) => val.split(cwdReal).join('<PROJECT_ROOT>'),
(val) => val.split(cwd).join('<PROJECT_ROOT>'),