mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-19 20:17:06 +02:00
chore: disable string escaping in snapshots (#7131)
This commit is contained in:
parent
4134ebb3fb
commit
9145ae88cc
60 changed files with 1881 additions and 1884 deletions
2
jest/snapshotPathNormalizer.ts
vendored
2
jest/snapshotPathNormalizer.ts
vendored
|
@ -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>'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue