Skip to content

Commit f2d3657

Browse files
committed
Remove console-testing-library as it is no longer needed
1 parent 84223b3 commit f2d3657

File tree

6 files changed

+0
-172
lines changed

6 files changed

+0
-172
lines changed

.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch

Lines changed: 0 additions & 68 deletions
This file was deleted.

.yarn/patches/console-testing-library__npm_0.3.1.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/toolkit/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"@typescript-eslint/eslint-plugin": "^6",
7272
"@typescript-eslint/parser": "^6",
7373
"axios": "^0.19.2",
74-
"console-testing-library": "patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch",
7574
"esbuild": "^0.23.0",
7675
"esbuild-extra": "^0.4.0",
7776
"eslint": "^7.25.0",

packages/toolkit/src/tests/utils/CustomMatchers.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Assertion, AsymmetricMatchersContaining } from 'vitest'
22

33
interface CustomMatchers<R = unknown> {
4-
toHaveConsoleOutput(expectedOutput: string): Promise<R>
54
toMatchSequence(...matchers: Array<(arg: any) => boolean>): R
65
}
76

packages/toolkit/src/tests/utils/helpers.tsx

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import { useCallback, useEffect, useRef } from 'react'
1212
import { Provider } from 'react-redux'
1313

1414
import { act, cleanup } from '@testing-library/react'
15-
import {
16-
createConsole,
17-
getLog,
18-
mockConsole,
19-
} from 'console-testing-library/pure'
2015

2116
export const ANY = 0 as any
2217

@@ -124,54 +119,6 @@ ${actions.map((a) => a.type).join('\n')}`,
124119
},
125120
})
126121

127-
declare global {
128-
namespace jest {
129-
interface Matchers<R> {
130-
toHaveConsoleOutput(expectedOutput: string): Promise<R>
131-
}
132-
}
133-
}
134-
135-
function normalize(str: string) {
136-
return str
137-
.normalize()
138-
.replace(/\s*\r?\n\r?\s*/g, '')
139-
.trim()
140-
}
141-
142-
expect.extend({
143-
async toHaveConsoleOutput(
144-
fn: () => void | Promise<void>,
145-
expectedOutput: string,
146-
) {
147-
const restore = mockConsole(createConsole())
148-
await fn()
149-
const { log } = getLog()
150-
restore()
151-
152-
if (normalize(log) === normalize(expectedOutput))
153-
return {
154-
message: () => `Console output matches
155-
===
156-
${expectedOutput}
157-
===`,
158-
pass: true,
159-
}
160-
else
161-
return {
162-
message: () => `Console output
163-
===
164-
${log}
165-
===
166-
does not match
167-
===
168-
${expectedOutput}
169-
===`,
170-
pass: false,
171-
}
172-
},
173-
})
174-
175122
export const actionsReducer = {
176123
actions: (state: UnknownAction[] = [], action: UnknownAction) => {
177124
// As of 2.0-beta.4, we are going to ignore all `subscriptionsUpdated` actions in tests

yarn.lock

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6693,7 +6693,6 @@ __metadata:
66936693
"@typescript-eslint/eslint-plugin": "npm:^6"
66946694
"@typescript-eslint/parser": "npm:^6"
66956695
axios: "npm:^0.19.2"
6696-
console-testing-library: "patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch"
66976696
esbuild: "npm:^0.23.0"
66986697
esbuild-extra: "npm:^0.4.0"
66996698
eslint: "npm:^7.25.0"
@@ -11862,28 +11861,6 @@ __metadata:
1186211861
languageName: node
1186311862
linkType: hard
1186411863

11865-
"console-testing-library@npm:0.6.1":
11866-
version: 0.6.1
11867-
resolution: "console-testing-library@npm:0.6.1"
11868-
dependencies:
11869-
jest-snapshot: "npm:^26.0.0"
11870-
pretty-format: "npm:^26.0.0"
11871-
strip-ansi: "npm:^6.0.0"
11872-
checksum: 10/3af3dc42fbc00673cd05bcda6c0deffe60f2339d511abebc839447490567728de8c5cfeaaa3eb98125e96d30e1920442d21476eddaac38837cfde397086cf8cc
11873-
languageName: node
11874-
linkType: hard
11875-
11876-
"console-testing-library@patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch":
11877-
version: 0.6.1
11878-
resolution: "console-testing-library@patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch::version=0.6.1&hash=95f56b"
11879-
dependencies:
11880-
jest-snapshot: "npm:^26.0.0"
11881-
pretty-format: "npm:^26.0.0"
11882-
strip-ansi: "npm:^6.0.0"
11883-
checksum: 10/2947f9733979954c144c687260e58cc58f31a5cd911ebadb00e06e9fc0a280d636171f9675f72cc60d7cf5f03323a1f79fadf9965617579e031b326d3565000f
11884-
languageName: node
11885-
linkType: hard
11886-
1188711864
"constant-case@npm:^3.0.4":
1188811865
version: 3.0.4
1188911866
resolution: "constant-case@npm:3.0.4"

0 commit comments

Comments
 (0)