Open CaioSilvaDti opened 1 year ago
Thanks, looks great;
Dont you also want to disable the initial trackPageView
event ? (line 91)
Could you please :
yarn lint --fix
should fix itadd a unit test ?
maybe something like :
test("should not trackPageView if disabled", async () => {
init({ siteId: "42", url: "YO", trackPageView: false });
window._paq = [];
push(["trackEvent", "kikoo", "lol"]);
Router.events.emit("routeChangeStart", "/path/to/hello?world");
return new Promise<void>((resolve) => {
expect(window._paq).toMatchSnapshot();
resolve();
});
});
The snapshot should only contain the push event and not the pageView
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
No Duplication information