Skip to content

Commit

Permalink
Remove console-testing-library as it is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Nov 11, 2024
1 parent da9ae2f commit bd04abd
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 172 deletions.
68 changes: 0 additions & 68 deletions .yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch

This file was deleted.

26 changes: 0 additions & 26 deletions .yarn/patches/console-testing-library__npm_0.3.1.patch

This file was deleted.

1 change: 0 additions & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"@typescript-eslint/eslint-plugin": "^6",
"@typescript-eslint/parser": "^6",
"axios": "^0.19.2",
"console-testing-library": "patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch",
"esbuild": "^0.23.0",
"esbuild-extra": "^0.4.0",
"eslint": "^7.25.0",
Expand Down
1 change: 0 additions & 1 deletion packages/toolkit/src/tests/utils/CustomMatchers.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Assertion, AsymmetricMatchersContaining } from 'vitest'

interface CustomMatchers<R = unknown> {
toHaveConsoleOutput(expectedOutput: string): Promise<R>
toMatchSequence(...matchers: Array<(arg: any) => boolean>): R
}

Expand Down
53 changes: 0 additions & 53 deletions packages/toolkit/src/tests/utils/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import { useCallback, useEffect, useRef } from 'react'
import { Provider } from 'react-redux'

import { act, cleanup } from '@testing-library/react'
import {
createConsole,
getLog,
mockConsole,
} from 'console-testing-library/pure'

export const ANY = 0 as any

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

declare global {
namespace jest {
interface Matchers<R> {
toHaveConsoleOutput(expectedOutput: string): Promise<R>
}
}
}

function normalize(str: string) {
return str
.normalize()
.replace(/\s*\r?\n\r?\s*/g, '')
.trim()
}

expect.extend({
async toHaveConsoleOutput(
fn: () => void | Promise<void>,
expectedOutput: string,
) {
const restore = mockConsole(createConsole())
await fn()
const { log } = getLog()
restore()

if (normalize(log) === normalize(expectedOutput))
return {
message: () => `Console output matches
===
${expectedOutput}
===`,
pass: true,
}
else
return {
message: () => `Console output
===
${log}
===
does not match
===
${expectedOutput}
===`,
pass: false,
}
},
})

export const actionsReducer = {
actions: (state: UnknownAction[] = [], action: UnknownAction) => {
// As of 2.0-beta.4, we are going to ignore all `subscriptionsUpdated` actions in tests
Expand Down
23 changes: 0 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6690,7 +6690,6 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^6"
"@typescript-eslint/parser": "npm:^6"
axios: "npm:^0.19.2"
console-testing-library: "patch:console-testing-library@npm%3A0.6.1#~/.yarn/patches/console-testing-library-npm-0.6.1-4d9957d402.patch"
esbuild: "npm:^0.23.0"
esbuild-extra: "npm:^0.4.0"
eslint: "npm:^7.25.0"
Expand Down Expand Up @@ -11846,28 +11845,6 @@ __metadata:
languageName: node
linkType: hard

"console-testing-library@npm:0.6.1":
version: 0.6.1
resolution: "console-testing-library@npm:0.6.1"
dependencies:
jest-snapshot: "npm:^26.0.0"
pretty-format: "npm:^26.0.0"
strip-ansi: "npm:^6.0.0"
checksum: 10/3af3dc42fbc00673cd05bcda6c0deffe60f2339d511abebc839447490567728de8c5cfeaaa3eb98125e96d30e1920442d21476eddaac38837cfde397086cf8cc
languageName: node
linkType: hard

"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
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"
dependencies:
jest-snapshot: "npm:^26.0.0"
pretty-format: "npm:^26.0.0"
strip-ansi: "npm:^6.0.0"
checksum: 10/2947f9733979954c144c687260e58cc58f31a5cd911ebadb00e06e9fc0a280d636171f9675f72cc60d7cf5f03323a1f79fadf9965617579e031b326d3565000f
languageName: node
linkType: hard

"constant-case@npm:^3.0.4":
version: 3.0.4
resolution: "constant-case@npm:3.0.4"
Expand Down

0 comments on commit bd04abd

Please sign in to comment.