Jest update v26.6.3 -> v29.5.1
Summary: ^ Basically, update Jest and fix any raised issues. Mainly: - Update necessary dependencies - Update snapshots - `useFakeTimers` caused a few issues which meant that the way we hook into the performance object had to be tweaked. The main code change is: `//fbsource/xplat/sonar/desktop/scripts/jest-setup-after.tsx` - `mocked` -> `jest.mocked` Changelog: Update Jest to v29.5.1 Reviewed By: antonk52 Differential Revision: D46319818 fbshipit-source-id: d218ca8f7e43abac6b00844953ddeb7f4e1010a2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
94cb8935b2
commit
6430403da0
@@ -66,11 +66,11 @@ test('$schema field is required', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
". should have required property \\"$schema\\" pointing to a supported schema URI, e.g.:
|
||||
[
|
||||
". should have required property "$schema" pointing to a supported schema URI, e.g.:
|
||||
{
|
||||
\\"$schema\\": \\"https://fbflipper.com/schemas/plugin-package/v2.json\\",
|
||||
\\"name\\": \\"flipper-plugin-example\\",
|
||||
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
|
||||
"name": "flipper-plugin-example",
|
||||
...
|
||||
}",
|
||||
]
|
||||
@@ -85,7 +85,7 @@ test('supported schema is required', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
[
|
||||
".$schema should point to a supported schema. Currently supported schemas:
|
||||
- https://fbflipper.com/schemas/plugin-package/v2.json",
|
||||
]
|
||||
@@ -100,7 +100,7 @@ test('name is required', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
[
|
||||
". should have required property 'name'",
|
||||
]
|
||||
`);
|
||||
@@ -113,8 +113,8 @@ test('name must start with "flipper-plugin-"', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"/name should start with \\"flipper-plugin-\\", e.g. \\"flipper-plugin-example\\"",
|
||||
[
|
||||
"/name should start with "flipper-plugin-", e.g. "flipper-plugin-example"",
|
||||
]
|
||||
`);
|
||||
});
|
||||
@@ -126,8 +126,8 @@ test('keywords must contain "flipper-plugin"', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"/keywords should contain keyword \\"flipper-plugin\\"",
|
||||
[
|
||||
"/keywords should contain keyword "flipper-plugin"",
|
||||
]
|
||||
`);
|
||||
});
|
||||
@@ -144,7 +144,7 @@ test('flippeBundlerEntry must point to an existing file', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
[
|
||||
"/flipperBundlerEntry should point to a valid file",
|
||||
]
|
||||
`);
|
||||
@@ -159,9 +159,9 @@ test('multiple validation errors reported', async () => {
|
||||
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
|
||||
const result = await runLint('dir');
|
||||
expect(result).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
[
|
||||
". should have required property 'flipperBundlerEntry'",
|
||||
"/keywords should contain keyword \\"flipper-plugin\\"",
|
||||
"/keywords should contain keyword "flipper-plugin"",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
@@ -72,31 +72,31 @@ test('converts package.json and adds dependencies', async () => {
|
||||
expect(error).toBeUndefined();
|
||||
expect(convertedPackageJsonString).toMatchInlineSnapshot(`
|
||||
"{
|
||||
\\"$schema\\": \\"https://fbflipper.com/schemas/plugin-package/v2.json\\",
|
||||
\\"name\\": \\"flipper-plugin-fresco\\",
|
||||
\\"id\\": \\"Fresco\\",
|
||||
\\"version\\": \\"1.0.0\\",
|
||||
\\"main\\": \\"dist/bundle.js\\",
|
||||
\\"flipperBundlerEntry\\": \\"index.tsx\\",
|
||||
\\"license\\": \\"MIT\\",
|
||||
\\"keywords\\": [
|
||||
\\"flipper-plugin\\",
|
||||
\\"images\\"
|
||||
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
|
||||
"name": "flipper-plugin-fresco",
|
||||
"id": "Fresco",
|
||||
"version": "1.0.0",
|
||||
"main": "dist/bundle.js",
|
||||
"flipperBundlerEntry": "index.tsx",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"flipper-plugin",
|
||||
"images"
|
||||
],
|
||||
\\"peerDependencies\\": {
|
||||
\\"flipper\\": \\"latest\\"
|
||||
"peerDependencies": {
|
||||
"flipper": "latest"
|
||||
},
|
||||
\\"devDependencies\\": {
|
||||
\\"flipper\\": \\"latest\\",
|
||||
\\"flipper-pkg\\": \\"latest\\"
|
||||
"devDependencies": {
|
||||
"flipper": "latest",
|
||||
"flipper-pkg": "latest"
|
||||
},
|
||||
\\"scripts\\": {
|
||||
\\"prepack\\": \\"yarn reset && yarn build && flipper-pkg lint && flipper-pkg bundle\\"
|
||||
"scripts": {
|
||||
"prepack": "yarn reset && yarn build && flipper-pkg lint && flipper-pkg bundle"
|
||||
},
|
||||
\\"title\\": \\"Images\\",
|
||||
\\"icon\\": \\"profile\\",
|
||||
\\"bugs\\": {
|
||||
\\"email\\": \\"example@test.com\\"
|
||||
"title": "Images",
|
||||
"icon": "profile",
|
||||
"bugs": {
|
||||
"email": "example@test.com"
|
||||
}
|
||||
}"
|
||||
`);
|
||||
@@ -107,27 +107,27 @@ test('converts package.json without changing dependencies', async () => {
|
||||
expect(error).toBeUndefined();
|
||||
expect(convertedPackageJsonString).toMatchInlineSnapshot(`
|
||||
"{
|
||||
\\"$schema\\": \\"https://fbflipper.com/schemas/plugin-package/v2.json\\",
|
||||
\\"name\\": \\"flipper-plugin-fresco\\",
|
||||
\\"id\\": \\"Fresco\\",
|
||||
\\"version\\": \\"1.0.0\\",
|
||||
\\"main\\": \\"dist/bundle.js\\",
|
||||
\\"flipperBundlerEntry\\": \\"index.tsx\\",
|
||||
\\"license\\": \\"MIT\\",
|
||||
\\"keywords\\": [
|
||||
\\"flipper-plugin\\",
|
||||
\\"images\\"
|
||||
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
|
||||
"name": "flipper-plugin-fresco",
|
||||
"id": "Fresco",
|
||||
"version": "1.0.0",
|
||||
"main": "dist/bundle.js",
|
||||
"flipperBundlerEntry": "index.tsx",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"flipper-plugin",
|
||||
"images"
|
||||
],
|
||||
\\"dependencies\\": {
|
||||
\\"flipper\\": \\"latest\\"
|
||||
"dependencies": {
|
||||
"flipper": "latest"
|
||||
},
|
||||
\\"scripts\\": {
|
||||
\\"prepack\\": \\"yarn reset && yarn build && flipper-pkg lint && flipper-pkg bundle\\"
|
||||
"scripts": {
|
||||
"prepack": "yarn reset && yarn build && flipper-pkg lint && flipper-pkg bundle"
|
||||
},
|
||||
\\"title\\": \\"Images\\",
|
||||
\\"icon\\": \\"profile\\",
|
||||
\\"bugs\\": {
|
||||
\\"email\\": \\"example@test.com\\"
|
||||
"title": "Images",
|
||||
"icon": "profile",
|
||||
"bugs": {
|
||||
"email": "example@test.com"
|
||||
}
|
||||
}"
|
||||
`);
|
||||
|
||||
Reference in New Issue
Block a user