diff --git a/src/test/bin/replaceImportFromStatic.ts b/src/test/bin/replaceImportFromStatic.ts index 0a8c7615..58b19ed1 100644 --- a/src/test/bin/replaceImportFromStatic.ts +++ b/src/test/bin/replaceImportFromStatic.ts @@ -28,6 +28,15 @@ import { assetIsSameCode } from "../tools/assertIsSameCode"; 3: "0664cdc0" }[e] + ".chunk.js" } + + n.u = function(e) { + return "static/js/" + e + "." + { + 147: "6c5cee76", + 787: "8da10fcf", + 922: "be170a73" + } [e] + ".chunk.js" + } + `; { @@ -48,6 +57,18 @@ import { assetIsSameCode } from "../tools/assertIsSameCode"; 3: "0664cdc0" }[e] + ".chunk.js" } + + n.u = function(e) { + Object.defineProperty(n, "p", { + get: function() { return window.kcContext.url.resourcesPath; }, + set: function (){} + }); + return "/build/static/js/" + e + "." + { + 147: "6c5cee76", + 787: "8da10fcf", + 922: "be170a73" + } [e] + ".chunk.js" + } `; assetIsSameCode(fixedJsCode, fixedJsCodeExpected); @@ -71,6 +92,21 @@ import { assetIsSameCode } from "../tools/assertIsSameCode"; 3: "0664cdc0" }[e] + ".chunk.js" } + + n.u = function(e) { + { + var p= ""; + Object.defineProperty(n, "p", { + get: function() { return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : "") + p; }, + set: function (value){ p = value;} + }); + } + return "static/js/" + e + "." + { + 147: "6c5cee76", + 787: "8da10fcf", + 922: "be170a73" + } [e] + ".chunk.js" + } `; assetIsSameCode(fixedJsCode, fixedJsCodeExpected);