Skip to content

Commit e61bbe2

Browse files
committed
chore(jest): use function instead of jest.fn
1 parent 79a472a commit e61bbe2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@decathlon/moon-testing",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "Moon testing utilities.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ export class AxiosClient {
3636
}
3737

3838
export function mockAxiosClientConstructor(ClientFactory = AxiosClient): void {
39-
Axios.create = jest.fn().mockImplementation(({ baseUrl }) => {
39+
Axios.create = ({ baseUrl }) => {
4040
return new ClientFactory(baseUrl);
41-
});
41+
};
4242
}
4343

4444
mockAxiosClientConstructor(AxiosClient);
4545

4646
export const cancelToken = { cancel: () => jest.fn() };
4747

48-
StaticAxios.CancelToken.source = jest.fn().mockReturnValue(cancelToken);
48+
StaticAxios.CancelToken.source = () => cancelToken;
4949

5050
export { default as MoonClient } from "./moon-client";
5151
export * from "./moon-client";

0 commit comments

Comments
 (0)