Skip to content

Commit 5643106

Browse files
authored
chore: remove expect from dev dependencies of pretty-format. (#13286)
1 parent 561907c commit 5643106

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

packages/pretty-format/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"@types/react": "^17.0.3",
2828
"@types/react-is": "^17.0.0",
2929
"@types/react-test-renderer": "17.0.2",
30-
"expect": "workspace:^",
3130
"immutable": "^4.0.0",
3231
"jest-util": "workspace:^",
3332
"react": "17.0.2",

packages/pretty-format/src/__tests__/AsymmetricMatcher.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {AsymmetricMatcher as AbstractAsymmetricMatcher} from 'expect';
98
import prettyFormat, {plugins} from '../';
109
import type {OptionsReceived} from '../types';
1110

@@ -349,10 +348,10 @@ test('min option', () => {
349348
);
350349
});
351350

352-
class DummyMatcher extends AbstractAsymmetricMatcher<number> {
353-
constructor(sample: number) {
354-
super(sample);
355-
}
351+
class DummyMatcher {
352+
$$typeof = Symbol.for('jest.asymmetricMatcher');
353+
354+
constructor(private sample: number) {}
356355

357356
asymmetricMatch(other: number) {
358357
return this.sample === other;
@@ -362,7 +361,7 @@ class DummyMatcher extends AbstractAsymmetricMatcher<number> {
362361
return 'DummyMatcher';
363362
}
364363

365-
override getExpectedType() {
364+
getExpectedType() {
366365
return 'number';
367366
}
368367
}

packages/pretty-format/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
},
88
"include": ["./src/**/*"],
99
"exclude": ["./**/__tests__/**/*"],
10-
// no `expect`, only used in tests
1110
"references": [{"path": "../jest-schemas"}, {"path": "../jest-util"}]
1211
}

scripts/buildTs.mjs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ import {getPackages} from './buildUtils.mjs';
6262
}
6363
}
6464

65-
// dev dep
66-
if (pkg.name === 'pretty-format') {
67-
if (dep === 'expect') {
68-
return false;
69-
}
70-
}
71-
7265
return true;
7366
})
7467
.map(dep =>

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16862,7 +16862,6 @@ __metadata:
1686216862
"@types/react-is": ^17.0.0
1686316863
"@types/react-test-renderer": 17.0.2
1686416864
ansi-styles: ^5.0.0
16865-
expect: "workspace:^"
1686616865
immutable: ^4.0.0
1686716866
jest-util: "workspace:^"
1686816867
react: 17.0.2

0 commit comments

Comments
 (0)