Skip to content

Commit 012973a

Browse files
test: make sure to check global properties
1 parent 3eebc6c commit 012973a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/index.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { createApp } from "vue";
2+
import * as api from "./api/index";
13
import addGtag from "./core/add-gtag";
24
import { createGtag } from "./index";
35

@@ -8,4 +10,13 @@ describe("index", () => {
810
createGtag({ tagId: "UA-123456789" });
911
expect(addGtag).toHaveBeenCalled();
1012
});
13+
14+
it("should install global properties", () => {
15+
const app = createApp({});
16+
const gtag = createGtag({ tagId: "UA-123456789" });
17+
18+
app.use(gtag);
19+
20+
expect(app.config.globalProperties.$gtag).toEqual(api);
21+
});
1122
});

0 commit comments

Comments
 (0)