Skip to content

Commit

Permalink
deps: jest ^29.0.0 (#953)
Browse files Browse the repository at this point in the history
* deps: jest ^29.0.0

* Fix up deps

* Remove dead option

* Add changeset

* Update snapshots

* Note snapshot change

* Upgrade `jest-watch-typeahead`

* Run `skuba format`

* Update template snapshot

* Clean up more snapshots

* Bump deps

* Bump `@types/jest`

* Try dropping resolution

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ryan Ling <ryan@outlook.com.au>
Co-authored-by: skuba <34733141+seek-oss-ci@users.noreply.github.com>
Co-authored-by: Sam Chung <samc@seek.com.au>
  • Loading branch information
4 people committed Sep 10, 2022
1 parent 659b2c0 commit 3c5413b
Show file tree
Hide file tree
Showing 27 changed files with 878 additions and 743 deletions.
21 changes: 21 additions & 0 deletions .changeset/nasty-ants-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'skuba': minor
---

deps: Jest 29

This major release includes breaking changes. See the [announcement post](https://jestjs.io/blog/2022/08/25/jest-29) for more information.

The `collectCoverageOnlyFrom` configuration option has been removed, and the default snapshot format has been simplified:

```diff
- Expected: \\"a\\"
+ Expected: "a"

- Object {
- Array []
- }
+ {
+ []
+ }
```
15 changes: 7 additions & 8 deletions jest/moduleNameMapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('moduleNameMapper', () => {
it('expands wildcard paths', () =>
expect(act({ 'src/*': ['src/*'], 'lib/wip/*': ['lib/wip/*'] }))
.toMatchInlineSnapshot(`
Object {
{
"^lib/wip$": "<rootDir>/lib/wip",
"^lib/wip/(.*)$": "<rootDir>/lib/wip/$1",
"^src$": "<rootDir>/src",
Expand All @@ -22,7 +22,7 @@ describe('moduleNameMapper', () => {

it('expands non-wildcard paths', () =>
expect(act({ cli: ['cli'], 'src/': ['src/'] })).toMatchInlineSnapshot(`
Object {
{
"^cli$": "<rootDir>/cli",
"^cli/(.*)$": "<rootDir>/cli/$1",
"^src$": "<rootDir>/src",
Expand All @@ -37,7 +37,7 @@ describe('moduleNameMapper', () => {
'jquery/*': ['node_modules/jquery/dist/jquery/*'],
}),
).toMatchInlineSnapshot(`
Object {
{
"^jquery$": "<rootDir>/node_modules/jquery/dist/jquery",
"^jquery/(.*)$": "<rootDir>/node_modules/jquery/dist/jquery/$1",
}
Expand All @@ -46,28 +46,27 @@ describe('moduleNameMapper', () => {
it('respects a base URL', () =>
expect(act({ cli: ['../cli'], 'app/*': ['app/*'] }, 'src'))
.toMatchInlineSnapshot(`
Object {
{
"^app$": "<rootDir>/src/app",
"^app/(.*)$": "<rootDir>/src/app/$1",
"^cli$": "<rootDir>/cli",
"^cli/(.*)$": "<rootDir>/cli/$1",
}
`));

it('respects no paths', () =>
expect(act({})).toMatchInlineSnapshot(`Object {}`));
it('respects no paths', () => expect(act({})).toMatchInlineSnapshot(`{}`));

it('falls back on undefined paths', () =>
expect(act(undefined)).toMatchInlineSnapshot(`
Object {
{
"^src$": "<rootDir>/src",
"^src/(.*)$": "<rootDir>/src/$1",
}
`));

it('falls back on invalid config', () =>
expect(act('INVALID')).toMatchInlineSnapshot(`
Object {
{
"^src$": "<rootDir>/src",
"^src/(.*)$": "<rootDir>/src/$1",
}
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
},
"dependencies": {
"@esbuild-plugins/tsconfig-paths": "^0.0.4",
"@jest/types": "^29.0.0",
"@octokit/graphql": "^5.0.0",
"@octokit/graphql-schema": "^12.0.0",
"@octokit/rest": "^19.0.0",
"@octokit/types": "^7.0.0",
"@types/jest": "^28.0.0",
"@types/jest": "^29.0.0",
"@types/node": ">=14.18",
"chalk": "^4.1.0",
"concurrently": "^7.0.0",
Expand All @@ -29,8 +30,8 @@
"ignore": "^5.1.8",
"is-installed-globally": "^0.4.0",
"isomorphic-git": "^1.11.1",
"jest": "^28.1.0",
"jest-watch-typeahead": "^2.0.0",
"jest": "^29.0.1",
"jest-watch-typeahead": "^2.1.1",
"lodash.mergewith": "^4.6.2",
"minimist": "^1.2.6",
"normalize-package-data": "^4.0.0",
Expand All @@ -47,18 +48,18 @@
"sort-package-json": "^1.57.0",
"strip-ansi": "^6.0.1",
"ts-dedent": "^2.2.0",
"ts-jest": "^28.0.2",
"ts-jest": "^29.0.0-next.0",
"ts-node": "^10.7.0",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.0.0",
"tsconfig-seek": "1.0.2",
"typescript": "~4.8.0"
"typescript": "~4.8.2"
},
"description": "SEEK development toolkit for backend applications and packages",
"devDependencies": {
"@changesets/cli": "2.24.3",
"@changesets/get-github-info": "0.5.1",
"@jest/reporters": "28.1.3",
"@jest/reporters": "29.0.1",
"@types/ejs": "3.1.1",
"@types/express": "4.17.13",
"@types/fs-extra": "9.0.13",
Expand Down
4 changes: 2 additions & 2 deletions src/api/buildkite/__snapshots__/md.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ exports[`terminal handles 1 backtick 1`] = `

exports[`terminal handles 3 backticks 1`] = `
"\`\`\`term
\\\\\`\\\\\`\\\\\`echo foo\\\\\`\\\\\`\\\\\`
\\\`\\\`\\\`echo foo\\\`\\\`\\\`
\`\`\`"
`;

exports[`terminal handles 6 backticks 1`] = `
"\`\`\`term
\\\\\`\\\\\`\\\\\`\\\\\`\\\\\`\\\\\`
\\\`\\\`\\\`\\\`\\\`\\\`
\`\`\`"
`;

Expand Down
6 changes: 3 additions & 3 deletions src/api/git/commit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('commit', () => {
expect(jest.mocked(git.commit).mock.calls[0][0]).toMatchInlineSnapshot(
{ fs: expect.any(Object) },
`
Object {
"author": Object {
{
"author": {
"name": "skuba",
},
"committer": Object {
"committer": {
"name": "skuba",
},
"dir": "/workdir/skuba",
Expand Down
2 changes: 1 addition & 1 deletion src/api/git/pull.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('fastForwardBranch', () => {
expect(jest.mocked(git.fastForward).mock.calls[0][0]).toMatchInlineSnapshot(
{ http: expect.any(Object), fs: expect.any(Object) },
`
Object {
{
"dir": "/workdir/skuba",
"fs": Any<Object>,
"http": Any<Object>,
Expand Down
2 changes: 1 addition & 1 deletion src/api/git/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('push', () => {
expect(jest.mocked(git.push).mock.calls[0][0]).toMatchInlineSnapshot(
{ http: expect.any(Object), fs: expect.any(Object) },
`
Object {
{
"dir": "/workdir/skuba",
"force": undefined,
"fs": Any<Object>,
Expand Down
22 changes: 11 additions & 11 deletions src/api/github/issueComment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.listComments).toHaveBeenCalledTimes(1);
expect(mockClient.issues.listComments.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"issue_number": 123,
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -60,7 +60,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.createComment).toHaveBeenCalledTimes(1);
expect(mockClient.issues.createComment.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"body": "Commentary!",
"issue_number": 123,
"owner": "seek-oss",
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('putIssueComment', () => {
expect(
mockClient.repos.listPullRequestsAssociatedWithCommit.mock.calls[0][0],
).toMatchInlineSnapshot(`
Object {
{
"commit_sha": "commit-id",
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -130,7 +130,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.listComments).toHaveBeenCalledTimes(1);
expect(mockClient.issues.listComments.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"issue_number": 123,
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -140,7 +140,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.createComment).toHaveBeenCalledTimes(1);
expect(mockClient.issues.createComment.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"body": "Commentary!",
"issue_number": 123,
"owner": "seek-oss",
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.listComments).toHaveBeenCalledTimes(1);
expect(mockClient.issues.listComments.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"issue_number": 123,
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -193,7 +193,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.createComment).toHaveBeenCalledTimes(1);
expect(mockClient.issues.createComment.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"body": "Commentary!
<!-- hunter2 -->",
Expand Down Expand Up @@ -245,7 +245,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.listComments).toHaveBeenCalledTimes(1);
expect(mockClient.issues.listComments.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"issue_number": 123,
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -255,7 +255,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.updateComment).toHaveBeenCalledTimes(1);
expect(mockClient.issues.updateComment.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"body": "Commentary!",
"comment_id": 111,
"issue_number": 123,
Expand Down Expand Up @@ -308,7 +308,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.listComments).toHaveBeenCalledTimes(1);
expect(mockClient.issues.listComments.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"issue_number": 123,
"owner": "seek-oss",
"repo": "skuba",
Expand All @@ -318,7 +318,7 @@ describe('putIssueComment', () => {
expect(mockClient.issues.updateComment).toHaveBeenCalledTimes(1);
expect(mockClient.issues.updateComment.mock.calls[0][0])
.toMatchInlineSnapshot(`
Object {
{
"body": "Commentary!
<!-- hunter2 -->",
Expand Down
2 changes: 1 addition & 1 deletion src/api/github/pullRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('getPullRequestNumber', () => {
expect(
mockClient.repos.listPullRequestsAssociatedWithCommit.mock.calls[0][0],
).toMatchInlineSnapshot(`
Object {
{
"commit_sha": "commit-id",
"owner": "seek-oss",
"repo": "skuba",
Expand Down
46 changes: 23 additions & 23 deletions src/api/github/push.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('uploadFileChanges', () => {
});

expect(jest.mocked(graphql).mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"
mutation Mutation($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
Expand All @@ -89,31 +89,31 @@ describe('uploadFileChanges', () => {
}
}
",
Object {
"headers": Object {
{
"headers": {
"authorization": "Bearer api-token",
},
"input": Object {
"branch": Object {
"input": {
"branch": {
"branchName": "existing-branch",
"repositoryNameWithOwner": "seek-oss/skuba",
},
"clientMutationId": "skuba",
"expectedHeadOid": "commit-id",
"fileChanges": Object {
"additions": Array [
Object {
"fileChanges": {
"additions": [
{
"contents": "",
"path": "another-path",
},
],
"deletions": Array [
Object {
"deletions": [
{
"path": "some-path",
},
],
},
"message": Object {
"message": {
"body": "commit body",
"headline": "commit headline",
},
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('uploadAllFileChanges', () => {
});

expect(jest.mocked(graphql).mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"
mutation Mutation($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
Expand All @@ -203,35 +203,35 @@ describe('uploadAllFileChanges', () => {
}
}
",
Object {
"headers": Object {
{
"headers": {
"authorization": "Bearer api-token",
},
"input": Object {
"branch": Object {
"input": {
"branch": {
"branchName": "existing-branch",
"repositoryNameWithOwner": "seek-oss/skuba",
},
"clientMutationId": "skuba",
"expectedHeadOid": "commit-id",
"fileChanges": Object {
"additions": Array [
Object {
"fileChanges": {
"additions": [
{
"contents": "base64-contents",
"path": "modified-file",
},
Object {
{
"contents": "base64-contents",
"path": "new-file",
},
],
"deletions": Array [
Object {
"deletions": [
{
"path": "deleted-file",
},
],
},
"message": Object {
"message": {
"body": "commit body",
"headline": "commit headline",
},
Expand Down
Loading

0 comments on commit 3c5413b

Please sign in to comment.