Skip to content

Commit 6bd2332

Browse files
fix: remove undefined global variable (#161)
1 parent 52ce110 commit 6bd2332

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

jest.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ const config: Config.InitialOptions = {
1919
"!src/devtools/**/*",
2020
"!src/vue/devtools/**/*",
2121
],
22-
globals: {
23-
"ts-jest": {},
24-
__VUE_PROD_DEVTOOLS__: false,
25-
},
2622
};
2723

2824
export default config;

src/vue/__tests__/vueQueryPlugin.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ describe("VueQueryPlugin", () => {
4949
});
5050

5151
test("should setup devtools", () => {
52-
// @ts-ignore
53-
global.__VUE_PROD_DEVTOOLS__ = true;
52+
const envCopy = process.env.NODE_ENV;
53+
process.env.NODE_ENV = "development";
5454
const setupDevtoolsMock = setupDevtools as jest.Mock;
5555
const appMock = getAppMock();
5656
VueQueryPlugin.install?.(appMock);
57+
process.env.NODE_ENV = envCopy;
5758

5859
expect(setupDevtoolsMock).toHaveBeenCalledTimes(1);
5960
});

src/vue/vueQueryPlugin.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export const VueQueryPlugin = {
7777
additionalClient.queryClient.mount();
7878
});
7979

80-
// @ts-expect-error Threeshakeable flags
81-
if (process.env.NODE_ENV === "development" || __VUE_PROD_DEVTOOLS__) {
80+
if (process.env.NODE_ENV === "development") {
8281
setupDevtools(this, client);
8382
}
8483
},
@@ -92,8 +91,7 @@ export const VueQueryPlugin = {
9291
additionalClient.queryClient.mount();
9392
});
9493
}
95-
// @ts-expect-error Threeshakeable flags
96-
if (process.env.NODE_ENV === "development" || __VUE_PROD_DEVTOOLS__) {
94+
if (process.env.NODE_ENV === "development") {
9795
setupDevtools(app, client);
9896
}
9997
},

0 commit comments

Comments
 (0)