Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert @testing-library/jest-dom v6 upgrade (#9713)" #9719

Merged
merged 3 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __fixtures__/test-project/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
4 changes: 2 additions & 2 deletions __fixtures__/test-project/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"types/*": ["./types/*", "../types/*"],
"@redwoodjs/testing": ["../node_modules/@redwoodjs/testing/web"]
},
"typeRoots": ["../node_modules/@types", "./node_modules/@types"],
"types": ["jest", "@testing-library/jest-dom"],
"typeRoots": ["../node_modules/@types", "./node_modules/@types", "../node_modules/@testing-library"],
"types": ["jest", "jest-dom"],
"jsx": "preserve"
},
"include": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@faker-js/faker": "8.0.2",
"@npmcli/arborist": "7.2.2",
"@playwright/test": "1.40.1",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.1.5",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.1",
"@types/babel__generator": "7.6.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"devDependencies": {
"@babel/cli": "7.23.4",
"@babel/core": "^7.22.20",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.1.5",
"@testing-library/react": "14.1.2",
"jest": "29.7.0",
"msw": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/__tests__/AuthProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
configure,
} from '@testing-library/react'
import { renderHook, act } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import { graphql } from 'msw'
import { setupServer } from 'msw/node'

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-config/src/__tests__/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('common', () => {
const apiTSConfig =
'{"compilerOptions": {"noEmit": true,"allowJs": true,"esModuleInterop": true,"target": "esnext","module": "esnext","moduleResolution": "node","baseUrl": "./","rootDirs": ["./src","../.redwood/types/mirror/api/src"],"paths": {"src/*": ["./src/*","../.redwood/types/mirror/api/src/*"],"types/*": ["./types/*", "../types/*"],"@redwoodjs/testing": ["../node_modules/@redwoodjs/testing/api"]},"typeRoots": ["../node_modules/@types","./node_modules/@types"],"types": ["jest"],},"include": ["src","../.redwood/types/includes/all-*","../.redwood/types/includes/api-*","../types"]}'
const webTSConfig =
'{"compilerOptions": {"noEmit": true,"allowJs": true,"esModuleInterop": true,"target": "esnext","module": "esnext","moduleResolution": "node","baseUrl": "./","rootDirs": ["./src","../.redwood/types/mirror/web/src","../api/src","../.redwood/types/mirror/api/src"],"paths": {"src/*": ["./src/*","../.redwood/types/mirror/web/src/*","../api/src/*","../.redwood/types/mirror/api/src/*"],"$api/*": [ "../api/*" ],"types/*": ["./types/*", "../types/*"],"@redwoodjs/testing": ["../node_modules/@redwoodjs/testing/web"]},"typeRoots": ["../node_modules/@types", "./node_modules/@types"],"types": ["jest", "@testing-library/jest-dom"],"jsx": "preserve",},"include": ["src","../.redwood/types/includes/all-*","../.redwood/types/includes/web-*","../types","./types"]}'
'{"compilerOptions": {"noEmit": true,"allowJs": true,"esModuleInterop": true,"target": "esnext","module": "esnext","moduleResolution": "node","baseUrl": "./","rootDirs": ["./src","../.redwood/types/mirror/web/src","../api/src","../.redwood/types/mirror/api/src"],"paths": {"src/*": ["./src/*","../.redwood/types/mirror/web/src/*","../api/src/*","../.redwood/types/mirror/api/src/*"],"$api/*": [ "../api/*" ],"types/*": ["./types/*", "../types/*"],"@redwoodjs/testing": ["../node_modules/@redwoodjs/testing/web"]},"typeRoots": ["../node_modules/@types", "./node_modules/@types", "../node_modules/@testing-library"],"types": ["jest-dom"],"jsx": "preserve",},"include": ["src","../.redwood/types/includes/all-*","../.redwood/types/includes/web-*","../types","./types"]}'

vol.fromNestedJSON(
{
Expand Down
6 changes: 3 additions & 3 deletions packages/create-redwood-app/templates/js/web/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
},
"typeRoots": [
"../node_modules/@types",
"./node_modules/@types"
"./node_modules/@types",
"../node_modules/@testing-library"
],
"types": [
"jest",
"@testing-library/jest-dom"
"jest-dom",
],
"jsx": "preserve"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/create-redwood-app/templates/ts/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"types/*": ["./types/*", "../types/*"],
"@redwoodjs/testing": ["../node_modules/@redwoodjs/testing/web"]
},
"typeRoots": ["../node_modules/@types", "./node_modules/@types"],
"types": ["jest", "@testing-library/jest-dom"],
"typeRoots": ["../node_modules/@types", "./node_modules/@types", "../node_modules/@testing-library"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tobbe do we need jest and jest-dom?

Copy link
Member Author

@Tobbe Tobbe Dec 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. The test project seems to work fine without jest. But I haven't looked into it more than that. So I'll add it back just to be sure.

"types": ["jest", "jest-dom"],
"jsx": "preserve"
},
"include": [
Expand Down
3 changes: 1 addition & 2 deletions packages/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
"@babel/cli": "7.23.4",
"@babel/core": "^7.22.20",
"@testing-library/dom": "9.3.3",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.1.5",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.1",
"@types/pascalcase": "1.0.3",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@types/testing-library__jest-dom": "5.14.9",
"graphql": "16.8.1",
"jest": "29.7.0",
"nodemon": "3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/location.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { LocationProvider, useLocation } from '../location'

Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/nestedSets.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import type { ReactNode } from 'react'

import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import { act, render } from '@testing-library/react'

import { navigate, Route, Router } from '../'
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/route-announcer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'

import { render, waitFor, act } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { getAnnouncement } from '../a11yUtils'
import { navigate } from '../history'
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/route-focus.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, waitFor } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { getFocus } from '../a11yUtils'
import RouteFocus from '../route-focus'
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/routeScrollReset.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import { act, cleanup, render, screen } from '@testing-library/react'

import { navigate } from '../history'
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/router.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jest.mock('../util', () => {

import React, { useEffect, useState } from 'react'

import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import {
act,
configure,
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/set.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import type { ReactNode } from 'react'

import { act, render, waitFor } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { navigate } from '../history'
import { Route, Router } from '../router'
Expand Down
2 changes: 1 addition & 1 deletion packages/router/src/__tests__/setContextReuse.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { act, render, waitFor } from '@testing-library/react'
import { Route, Router, navigate } from '../'
import { Set } from '../Set'

import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

const HomePage = () => {
return <p>Home Page</p>
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import '@testing-library/jest-dom'

import { startMSW } from './src/web/mockRequests'
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@redwoodjs/project-config": "6.0.7",
"@redwoodjs/router": "6.0.7",
"@redwoodjs/web": "6.0.7",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.1.5",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.1",
"@types/aws-lambda": "8.10.126",
Expand Down
3 changes: 1 addition & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@
"@apollo/experimental-nextjs-app-support": "0.5.1",
"@babel/cli": "7.23.4",
"@babel/core": "^7.22.20",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/jest-dom": "6.1.5",
"@testing-library/react": "14.1.2",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@types/testing-library__jest-dom": "5.14.9",
"jest": "29.7.0",
"nodemon": "3.0.2",
"react": "0.0.0-experimental-e5205658f-20230913",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/FetchConfigProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react'
import { render, screen, waitFor } from '@testing-library/react'

import type { AuthContextInterface } from '@redwoodjs/auth'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

globalThis.RWJS_API_GRAPHQL_URL = 'https://api.example.com/graphql'

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/GraphQLHooksProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { render, screen, waitFor } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import {
GraphQLHooksProvider,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/cell/createCell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { GraphQLHooksProvider } from '../GraphQLHooksProvider'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { useReadQuery, useBackgroundQuery } from '@apollo/client'
import { loadErrorMessages, loadDevMessages } from '@apollo/client/dev'
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'

import { GraphQLHooksProvider } from '../GraphQLHooksProvider'

Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/portalHead.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import '@testing-library/jest-dom/extend-expect'
import '@testing-library/jest-dom/jest-globals'
import { render } from '@testing-library/react'

import PortalHead from './PortalHead'
Expand Down
56 changes: 29 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ __metadata:
languageName: node
linkType: hard

"@adobe/css-tools@npm:^4.0.1":
version: 4.3.1
resolution: "@adobe/css-tools@npm:4.3.1"
checksum: 05672719b544cc0c21ae3ed0eb6349bf458e9d09457578eeeb07cf0f696469ac6417e9c9be1b129e5d6a18098a061c1db55b2275591760ef30a79822436fcbfa
"@adobe/css-tools@npm:^4.3.1":
version: 4.3.2
resolution: "@adobe/css-tools@npm:4.3.2"
checksum: 296a03dd29f227c60500d2da8c7f64991fecf1d8b456ce2b4adb8cec7363d9c08b5b03f1463673fc8cbfe54b538745588e7a13c736d2dd14a80c01a20f127f39
languageName: node
linkType: hard

Expand Down Expand Up @@ -8588,7 +8588,7 @@ __metadata:
"@babel/cli": "npm:7.23.4"
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.23.6"
"@testing-library/jest-dom": "npm:5.17.0"
"@testing-library/jest-dom": "npm:6.1.5"
"@testing-library/react": "npm:14.1.2"
core-js: "npm:3.34.0"
jest: "npm:29.7.0"
Expand Down Expand Up @@ -8957,13 +8957,12 @@ __metadata:
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.23.6"
"@testing-library/dom": "npm:9.3.3"
"@testing-library/jest-dom": "npm:5.17.0"
"@testing-library/jest-dom": "npm:6.1.5"
"@testing-library/react": "npm:14.1.2"
"@testing-library/user-event": "npm:14.5.1"
"@types/pascalcase": "npm:1.0.3"
"@types/react": "npm:18.2.37"
"@types/react-dom": "npm:18.2.15"
"@types/testing-library__jest-dom": "npm:5.14.9"
core-js: "npm:3.34.0"
graphql: "npm:16.8.1"
jest: "npm:29.7.0"
Expand Down Expand Up @@ -9430,7 +9429,7 @@ __metadata:
"@redwoodjs/project-config": "npm:6.0.7"
"@redwoodjs/router": "npm:6.0.7"
"@redwoodjs/web": "npm:6.0.7"
"@testing-library/jest-dom": "npm:5.17.0"
"@testing-library/jest-dom": "npm:6.1.5"
"@testing-library/react": "npm:14.1.2"
"@testing-library/user-event": "npm:14.5.1"
"@types/aws-lambda": "npm:8.10.126"
Expand Down Expand Up @@ -9539,11 +9538,10 @@ __metadata:
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.23.6"
"@redwoodjs/auth": "npm:6.0.7"
"@testing-library/jest-dom": "npm:5.17.0"
"@testing-library/jest-dom": "npm:6.1.5"
"@testing-library/react": "npm:14.1.2"
"@types/react": "npm:18.2.37"
"@types/react-dom": "npm:18.2.15"
"@types/testing-library__jest-dom": "npm:5.14.9"
core-js: "npm:3.34.0"
graphql: "npm:16.8.1"
graphql-sse: "npm:2.4.0"
Expand Down Expand Up @@ -11092,20 +11090,33 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/jest-dom@npm:5.17.0":
version: 5.17.0
resolution: "@testing-library/jest-dom@npm:5.17.0"
"@testing-library/jest-dom@npm:6.1.5":
version: 6.1.5
resolution: "@testing-library/jest-dom@npm:6.1.5"
dependencies:
"@adobe/css-tools": "npm:^4.0.1"
"@adobe/css-tools": "npm:^4.3.1"
"@babel/runtime": "npm:^7.9.2"
"@types/testing-library__jest-dom": "npm:^5.9.1"
aria-query: "npm:^5.0.0"
chalk: "npm:^3.0.0"
css.escape: "npm:^1.5.1"
dom-accessibility-api: "npm:^0.5.6"
lodash: "npm:^4.17.15"
redent: "npm:^3.0.0"
checksum: 24e09c5779ea44644945ec26f2e4e5f48aecfe57d469decf2317a3253a5db28d865c55ad0ea4818d8d1df7572a6486c45daa06fa09644a833a7dd84563881939
peerDependencies:
"@jest/globals": ">= 28"
"@types/jest": ">= 28"
jest: ">= 28"
vitest: ">= 0.32"
peerDependenciesMeta:
"@jest/globals":
optional: true
"@types/jest":
optional: true
jest:
optional: true
vitest:
optional: true
checksum: f3643a56fcd970b5c7e8fd10faf3c4817d8ab0e74fb1198d726643bdc5ac675ceaac3b0068c5b4fbad254470e8f98ed50028741de875a29ceaa2f854570979c9
languageName: node
linkType: hard

Expand Down Expand Up @@ -11890,7 +11901,7 @@ __metadata:
languageName: node
linkType: hard

"@types/jest@npm:*, @types/jest@npm:29.5.8":
"@types/jest@npm:29.5.8":
version: 29.5.8
resolution: "@types/jest@npm:29.5.8"
dependencies:
Expand Down Expand Up @@ -12483,15 +12494,6 @@ __metadata:
languageName: node
linkType: hard

"@types/testing-library__jest-dom@npm:5.14.9, @types/testing-library__jest-dom@npm:^5.9.1":
version: 5.14.9
resolution: "@types/testing-library__jest-dom@npm:5.14.9"
dependencies:
"@types/jest": "npm:*"
checksum: 91f7b15e8813b515912c54da44464fb60ecf21162b7cae2272fcb3918074f4e1387dc2beca1f5041667e77b76b34253c39675ea4e0b3f28f102d8cc87fdba9fa
languageName: node
linkType: hard

"@types/tough-cookie@npm:*":
version: 4.0.2
resolution: "@types/tough-cookie@npm:4.0.2"
Expand Down Expand Up @@ -31676,7 +31678,7 @@ __metadata:
"@faker-js/faker": "npm:8.0.2"
"@npmcli/arborist": "npm:7.2.2"
"@playwright/test": "npm:1.40.1"
"@testing-library/jest-dom": "npm:5.17.0"
"@testing-library/jest-dom": "npm:6.1.5"
"@testing-library/react": "npm:14.1.2"
"@testing-library/user-event": "npm:14.5.1"
"@types/babel__generator": "npm:7.6.7"
Expand Down