Skip to content

Commit

Permalink
fix(deps): update jest monorepo to v29 (major) (#7862)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] committed Aug 31, 2022
1 parent ed736e3 commit 6c09093
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 488 deletions.
4 changes: 2 additions & 2 deletions docs/markdoc/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ test('duplicate headings without disambiguated ids error', () => {
expect(() => transformDocContent('content.md', content)).toThrowErrorMatchingInlineSnapshot(`
"Errors in content.md:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
content.md:1: The id for this heading is \\"heading-1\\" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
content.md:2: The id for this heading is \\"heading-1\\" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
content.md:1: The id for this heading is "heading-1" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
content.md:2: The id for this heading is "heading-1" which is the same as another heading in this file, disambiguate them with {% #some-id-here %} after a heading
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯"
`);
});
Expand Down
4 changes: 2 additions & 2 deletions examples/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@keystone-6/core": "^2.2.0"
},
"devDependencies": {
"babel-jest": "^28.1.3",
"jest": "^28.1.3",
"babel-jest": "^29.0.1",
"jest": "^29.0.0",
"typescript": "^4.7.4"
},
"repository": "https://github.com/keystonejs/keystone/tree/main/examples/testing"
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"@babel/preset-typescript": "^7.16.0",
"@changesets/changelog-github": "^0.4.1",
"@changesets/cli": "^2.18.0",
"@jest/test-sequencer": "^28.0.0",
"@jest/test-sequencer": "^29.0.0",
"@manypkg/cli": "^0.19.1",
"@preconstruct/cli": "2.2.1",
"@preconstruct/eslint-plugin-format-js-tag": "^0.2.0",
"@testing-library/jest-dom": "^5.15.0",
"@types/babel__core": "^7.1.16",
"@types/jest": "^28.0.0",
"@types/jest": "^29.0.0",
"@types/node-fetch": "^2.5.12",
"@types/normalize-path": "3.0.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
Expand All @@ -68,8 +68,8 @@
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
"is-ci": "^3.0.1",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
"patch-package": "^6.4.7",
"prettier": "^2.5.0",
"react": "^18.1.0",
Expand Down Expand Up @@ -159,9 +159,6 @@
"//": "remove when https://github.com/uuidjs/uuid/pull/616 is merged",
"moduleNameMapper": {
"^uuid$": "<rootDir>/node_modules/uuid/dist/index.js"
},
"snapshotFormat": {
"printBasicPrototype": false
}
}
}
88 changes: 44 additions & 44 deletions packages/core/src/scripts/tests/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ describe('useMigrations: false', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
Expand Down Expand Up @@ -198,13 +198,13 @@ describe('useMigrations: false', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
id String @id
title String @default(\\"\\")
title String @default("")
}
"
`);
Expand Down Expand Up @@ -327,13 +327,13 @@ describe('useMigrations: true', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
id String @id
title String @default(\\"\\")
title String @default("")
isComplete Boolean @default(false)
}
"
Expand All @@ -344,14 +344,14 @@ describe('useMigrations: true', () => {
expect(migration).toMatchInlineSnapshot(`
"-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE \\"new_Todo\\" (
\\"id\\" TEXT NOT NULL PRIMARY KEY,
\\"title\\" TEXT NOT NULL DEFAULT '',
\\"isComplete\\" BOOLEAN NOT NULL DEFAULT false
CREATE TABLE "new_Todo" (
"id" TEXT NOT NULL PRIMARY KEY,
"title" TEXT NOT NULL DEFAULT '',
"isComplete" BOOLEAN NOT NULL DEFAULT false
);
INSERT INTO \\"new_Todo\\" (\\"id\\", \\"title\\") SELECT \\"id\\", \\"title\\" FROM \\"Todo\\";
DROP TABLE \\"Todo\\";
ALTER TABLE \\"new_Todo\\" RENAME TO \\"Todo\\";
INSERT INTO "new_Todo" ("id", "title") SELECT "id", "title" FROM "Todo";
DROP TABLE "Todo";
ALTER TABLE "new_Todo" RENAME TO "Todo";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
"
Expand Down Expand Up @@ -395,8 +395,8 @@ describe('useMigrations: true', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
Expand All @@ -420,12 +420,12 @@ describe('useMigrations: true', () => {
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE \\"new_Todo\\" (
\\"id\\" TEXT NOT NULL PRIMARY KEY
CREATE TABLE "new_Todo" (
"id" TEXT NOT NULL PRIMARY KEY
);
INSERT INTO \\"new_Todo\\" (\\"id\\") SELECT \\"id\\" FROM \\"Todo\\";
DROP TABLE \\"Todo\\";
ALTER TABLE \\"new_Todo\\" RENAME TO \\"Todo\\";
INSERT INTO "new_Todo" ("id") SELECT "id" FROM "Todo";
DROP TABLE "Todo";
ALTER TABLE "new_Todo" RENAME TO "Todo";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
"
Expand Down Expand Up @@ -468,13 +468,13 @@ describe('useMigrations: true', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
id String @id
title String @default(\\"\\")
title String @default("")
}
"
`);
Expand All @@ -483,9 +483,9 @@ describe('useMigrations: true', () => {

expect(migration).toMatchInlineSnapshot(`
"-- CreateTable
CREATE TABLE \\"Todo\\" (
\\"id\\" TEXT NOT NULL PRIMARY KEY,
\\"title\\" TEXT NOT NULL DEFAULT ''
CREATE TABLE "Todo" (
"id" TEXT NOT NULL PRIMARY KEY,
"title" TEXT NOT NULL DEFAULT ''
);
"
`);
Expand All @@ -512,7 +512,7 @@ describe('useMigrations: true', () => {
- The following migration(s) are applied to the database but missing from the local migrations directory: old_migration_name
We need to reset the sqlite database \\"app.db\\" at file:./app.db.
We need to reset the sqlite database "app.db" at file:./app.db.
Prompt: Do you want to continue? All data will be lost. true
✨ There has been a change to your Keystone schema that requires a migration
Expand Down Expand Up @@ -560,7 +560,7 @@ describe('useMigrations: true', () => {
- The following migration(s) are applied to the database but missing from the local migrations directory: old_migration_name
We need to reset the sqlite database \\"app.db\\" at file:./app.db.
We need to reset the sqlite database "app.db" at file:./app.db.
Prompt: Do you want to continue? All data will be lost. false
Reset cancelled."
Expand Down Expand Up @@ -589,13 +589,13 @@ describe('useMigrations: true', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
id String @id
title String @default(\\"\\")
title String @default("")
}
"
`);
Expand All @@ -609,14 +609,14 @@ describe('useMigrations: true', () => {
.toMatchInlineSnapshot(`
"-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE \\"new_Todo\\" (
\\"id\\" TEXT NOT NULL PRIMARY KEY,
\\"title\\" TEXT NOT NULL DEFAULT '',
\\"isComplete\\" BOOLEAN NOT NULL DEFAULT false
CREATE TABLE "new_Todo" (
"id" TEXT NOT NULL PRIMARY KEY,
"title" TEXT NOT NULL DEFAULT '',
"isComplete" BOOLEAN NOT NULL DEFAULT false
);
INSERT INTO \\"new_Todo\\" (\\"id\\", \\"title\\") SELECT \\"id\\", \\"title\\" FROM \\"Todo\\";
DROP TABLE \\"Todo\\";
ALTER TABLE \\"new_Todo\\" RENAME TO \\"Todo\\";
INSERT INTO "new_Todo" ("id", "title") SELECT "id", "title" FROM "Todo";
DROP TABLE "Todo";
ALTER TABLE "new_Todo" RENAME TO "Todo";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
"
Expand Down Expand Up @@ -648,13 +648,13 @@ describe('useMigrations: true', () => {

expect(await introspectDb(tmp, dbUrl)).toMatchInlineSnapshot(`
"datasource db {
provider = \\"sqlite\\"
url = \\"file:./app.db\\"
provider = "sqlite"
url = "file:./app.db"
}
model Todo {
id String @id
title String @default(\\"\\")
title String @default("")
}
"
`);
Expand All @@ -667,7 +667,7 @@ describe('useMigrations: true', () => {
⭐️ Dev Server Starting on http://localhost:3000
⭐️ GraphQL API Starting on http://localhost:3000/api/graphql
✨ Generating GraphQL and Prisma schemas
✨ sqlite database \\"app.db\\" created at file:./app.db
✨ sqlite database "app.db" created at file:./app.db
Applying migration \`migration_name\`
✨ The following migration(s) have been applied:
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/scripts/tests/prisma.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('keystone prisma exits with the same code as the prisma child process exits
expect(result.exitCode).toBe(1);
expect(stripAnsi(result.all!)).toMatchInlineSnapshot(`
"
! Unknown command \\"bad-thing\\"
! Unknown command "bad-thing"
◭ Prisma is a modern DB toolkit to query, migrate and model your database (https://prisma.io)
Expand Down Expand Up @@ -76,7 +76,7 @@ test('keystone prisma uses the db url in the keystone config', async () => {
expect(result.exitCode).toBe(0);
expect(stripAnsi(result.all!)).toMatchInlineSnapshot(`
"Prisma schema loaded from schema.prisma
Datasource \\"sqlite\\": SQLite database \\"app.db\\" at \\"file:./app.db\\"
Datasource "sqlite": SQLite database "app.db" at "file:./app.db"
Database connection error:
Expand Down
4 changes: 2 additions & 2 deletions packages/fields-document/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"@keystone-6/core": "*",
"@testing-library/react": "^13.2.0",
"array.prototype.flat": "^1.2.5",
"jest-diff": "^28.1.3",
"pretty-format": "^28.1.3",
"jest-diff": "^29.0.0",
"pretty-format": "^29.0.0",
"slate-hyperscript": "^0.67.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ test('does not allow circular object', () => {
expect(() => {
assertValidComponentSchema(easilyCircularObject, new Set());
}).toThrowErrorMatchingInlineSnapshot(
`"The field \\"object.x\\" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
`"The field "object.x" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
);
});

test('does not allow a circular object within an array', () => {
expect(() => {
assertValidComponentSchema(fields.array(easilyCircularObject), new Set());
}).toThrowErrorMatchingInlineSnapshot(
`"The field \\"array.object.x\\" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
`"The field "array.object.x" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
);
});

Expand All @@ -35,10 +35,11 @@ test('does not allow a circular object within a value for a default discriminant
true: fields.empty(),
false: easilyCircularObject,
}),

new Set()
);
}).toThrowErrorMatchingInlineSnapshot(
`"The field \\"conditional.false.object.x\\" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
`"The field "conditional.false.object.x" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
);
});

Expand All @@ -49,10 +50,11 @@ test('does not allow a circular object within a value for a non-default discrimi
true: easilyCircularObject,
false: fields.empty(),
}),

new Set()
);
}).toThrowErrorMatchingInlineSnapshot(
`"The field \\"conditional.true.object.x\\" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
`"The field "conditional.true.object.x" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
);
});

Expand Down Expand Up @@ -84,7 +86,7 @@ test("does not allow a circular conditional if it's the default", () => {
expect(() => {
assertValidComponentSchema(conditional, new Set());
}).toThrowErrorMatchingInlineSnapshot(
`"The field \\"conditional.false\\" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
`"The field "conditional.false" is the same as it's ancestor. Use an array or conditional field for recursive structures."`
);
});

Expand Down Expand Up @@ -121,7 +123,7 @@ test('does not allow a field that returns a different field from a getter each t
expect(() => {
assertValidComponentSchema(blah(), new Set());
}).toThrowErrorMatchingInlineSnapshot(
`"Fields on an object field must not change over time but the field at \\"array.object.blah\\" changes between accesses"`
`"Fields on an object field must not change over time but the field at "array.object.blah" changes between accesses"`
);
});

Expand Down Expand Up @@ -158,7 +160,7 @@ test('relationship field where no list exists with that name', () => {
new Set()
);
}).toThrowErrorMatchingInlineSnapshot(
`"The relationship field at \\"object.a\\" has the listKey \\"Blah\\" but no list named \\"Blah\\" exists."`
`"The relationship field at "object.a" has the listKey "Blah" but no list named "Blah" exists."`
);
});

Expand Down

0 comments on commit 6c09093

Please sign in to comment.