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 2d26e02 commit d7e0776Copy full SHA for d7e0776
packages/fetch-mock/src/FetchMock.ts
@@ -4,6 +4,10 @@ import { MatcherDefinition, RouteMatcher } from './Matchers.js';
4
import CallHistory from './CallHistory.js';
5
import * as requestUtils from './RequestUtils.js';
6
7
+export type HardResetOptions = {
8
+ includeSticky?: boolean;
9
+}
10
+
11
export type FetchMockGlobalConfig = {
12
includeContentLength?: boolean;
13
matchPartialBody?: boolean;
@@ -146,6 +150,13 @@ export class FetchMock {
146
150
return this;
147
151
}
148
152
153
+ hardReset(options?: HardResetOptions): FetchMock {
154
+ this.clearHistory();
155
+ this.removeRoutes(options as RemoveRouteOptions);
156
+ this.unmockGlobal();
157
+ return this;
158
+ }
159
149
160
spy(
161
this: FetchMock,
162
matcher?: RouteMatcher | UserRouteConfig,
0 commit comments