Skip to content

Commit c34e9b1

Browse files
committed
test: add test for prod env
1 parent 536d800 commit c34e9b1

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/vue/__tests__/vueQueryPlugin.test.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,24 @@ describe("VueQueryPlugin", () => {
3939
jest.clearAllMocks();
4040
});
4141

42-
test("should setup devtools", () => {
43-
// @ts-ignore
44-
global.__VUE_PROD_DEVTOOLS__ = true;
45-
const setupDevtoolsMock = setupDevtools as jest.Mock;
46-
const appMock = getAppMock();
47-
VueQueryPlugin.install?.(appMock);
48-
49-
expect(setupDevtoolsMock).toHaveBeenCalledTimes(1);
42+
describe("devtools", () => {
43+
test("should NOT setup devtools", () => {
44+
const setupDevtoolsMock = setupDevtools as jest.Mock;
45+
const appMock = getAppMock();
46+
VueQueryPlugin.install?.(appMock);
47+
48+
expect(setupDevtoolsMock).toHaveBeenCalledTimes(0);
49+
});
50+
51+
test("should setup devtools", () => {
52+
// @ts-ignore
53+
global.__VUE_PROD_DEVTOOLS__ = true;
54+
const setupDevtoolsMock = setupDevtools as jest.Mock;
55+
const appMock = getAppMock();
56+
VueQueryPlugin.install?.(appMock);
57+
58+
expect(setupDevtoolsMock).toHaveBeenCalledTimes(1);
59+
});
5060
});
5161

5262
describe("when app unmounts", () => {

0 commit comments

Comments
 (0)