From d5ebd277502b20f4b36962db7da305de32d6868a Mon Sep 17 00:00:00 2001 From: Thorsten Kober Date: Fri, 2 Aug 2024 13:54:57 -0400 Subject: [PATCH] fix tests --- src/third-parties/google-tag-manager/data.json | 2 +- src/utils/index.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/third-parties/google-tag-manager/data.json b/src/third-parties/google-tag-manager/data.json index 50447b6..6c5667f 100644 --- a/src/third-parties/google-tag-manager/data.json +++ b/src/third-parties/google-tag-manager/data.json @@ -15,7 +15,7 @@ "key": "gtm" }, { - "code": "window[{{l}}]=window[{{l}}]||[];window[{{l}}].push({'gtm.start':new Date().getTime(),event:'gtm.js'});", + "code": "window['{{l}}']=window['{{l}}']||[];window['{{l}}'].push({'gtm.start':new Date().getTime(),event:'gtm.js'});", "optionalParams": { "l": "dataLayer" }, diff --git a/src/utils/index.test.ts b/src/utils/index.test.ts index c98fbfe..1e3038f 100644 --- a/src/utils/index.test.ts +++ b/src/utils/index.test.ts @@ -268,7 +268,7 @@ describe('Utils', () => { }, scripts: [ { - code: 'window[{{hello}}]=window[{{hello}}]||[];console.log({{world}})', + code: 'window["{{hello}}"]=window["{{hello}}"]||[];console.log("{{world}}")', optionalParams: { hello: 'hoho', }, @@ -300,7 +300,7 @@ describe('Utils', () => { const inputs = [ // string { - input: 'window[{{l}}]=window[{{l}}]||[];', + input: 'window["{{l}}"]=window["{{l}}"]||[];', params: { l: 'some-datalayer', }, @@ -356,7 +356,7 @@ describe('Utils', () => { expect( formatCode(input, { l: 'test' }, { l: 'dataLayer' }), - ).toMatchInlineSnapshot(`"window["test"]=window["test"]||[];"`); + ).toMatchInlineSnapshot(`"window[test]=window[test]||[];"`); }); }); });