Skip to content

Commit

Permalink
Writing tests for #141
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Jul 22, 2022
1 parent 0b790c4 commit d877d90
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/test/bin/replaceImportFromStatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
`;

{
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d877d90

Please sign in to comment.