chore: 处理jest 28 => 29后snapshot格式不兼容问题 (#5487)

This commit is contained in:
RUNZE LU 2022-09-30 18:09:35 +08:00 committed by GitHub
parent 4ec44e10af
commit 41bdee3332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -85,6 +85,10 @@
"testPathIgnorePatterns": [
"/node_modules/",
"/.rollup.cache/"
]
],
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
}
}
}

View File

@ -1,4 +1,5 @@
import {parse} from '../src/index';
test('parser:simple', () => {
expect(
parse('expression result is ${a + b}', {

View File

@ -94,7 +94,11 @@
},
"setupFilesAfterEnv": [
"<rootDir>/__tests__/jest.setup.js"
]
],
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
}
},
"gitHead": "37d23b4a8eb1c663bc38e8dd9040889ea1526ec4"
}

View File

@ -29,6 +29,7 @@ import '../../src';
import {clearStoresCache, render as amisRender} from '../../src';
import {makeEnv as makeEnvRaw, wait} from '../helper';
import rows from '../mockData/rows';
import type {RenderOptions} from '../../src';
afterEach(() => {
cleanup();
@ -37,7 +38,8 @@ afterEach(() => {
});
/** 避免updateLocation里的console.error */
const makeEnv = args => makeEnvRaw({updateLocation: () => {}, ...args});
const makeEnv = (env?: Partial<RenderOptions>) =>
makeEnvRaw({updateLocation: () => {}, ...env});
async function fetcher(config: any) {
return {

View File

@ -215,7 +215,11 @@
"testPathIgnorePatterns": [
"/node_modules/",
"/.rollup.cache/"
]
],
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
}
},
"peerDependencies": {
"amis-core": "*",