We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e27117a commit 57dd54fCopy full SHA for 57dd54f
src/plugin-tester.ts
@@ -115,9 +115,16 @@ function pluginTester(options: PluginTesterOptions = {}) {
115
const globalContextHasDescribeFn =
116
'describe' in globalThis && typeof describe == 'function';
117
118
- const globalContextExpectFnHasToMatchSnapshot = globalContextHasExpectFn
+ const globalContextExpectFnHasToMatchSnapshot = (() => {
119
+ try {
120
+ return globalContextHasExpectFn
121
? typeof expect(undefined)?.toMatchSnapshot == 'function'
122
: false;
123
+ } catch {
124
+ /* istanbul ignore next */
125
+ return false;
126
+ }
127
+ })();
128
129
const globalContextTestFnHasSkip = globalContextHasTestFn
130
? typeof it.skip == 'function'
0 commit comments