Fix tests

This commit is contained in:
Joseph Garrone 2024-06-09 09:36:16 +02:00
parent 9c123f37c8
commit 2441d8ed8a

View File

@ -21,8 +21,8 @@ describe("js replacer - vite", () => {
const { fixedJsCode } = replaceImportsInJsCode_vite({ const { fixedJsCode } = replaceImportsInJsCode_vite({
jsCode: jsCodeUntransformed, jsCode: jsCodeUntransformed,
basenameOfAssetsFiles: [], basenameOfAssetsFiles: [],
buildOptions: { buildContext: {
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/dist/", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/dist/",
assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets/", assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets/",
urlPathname: "/foo-bar-baz/" urlPathname: "/foo-bar-baz/"
} }
@ -41,8 +41,8 @@ describe("js replacer - vite", () => {
const { fixedJsCode } = replaceImportsInJsCode_vite({ const { fixedJsCode } = replaceImportsInJsCode_vite({
jsCode: jsCodeUntransformed, jsCode: jsCodeUntransformed,
basenameOfAssetsFiles: [], basenameOfAssetsFiles: [],
buildOptions: { buildContext: {
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/dist/", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/dist/",
assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets/", assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets/",
urlPathname: "/foo/bar/baz/" urlPathname: "/foo/bar/baz/"
} }
@ -65,15 +65,15 @@ describe("js replacer - vite", () => {
} }
`; `;
for (const { reactAppBuildDirPath, assetsDirPath, systemType } of [ for (const { projectBuildDirPath, assetsDirPath, systemType } of [
{ {
systemType: "posix", systemType: "posix",
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/dist", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/dist",
assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets" assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets"
}, },
{ {
systemType: "win32", systemType: "win32",
reactAppBuildDirPath: projectBuildDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist", "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist",
assetsDirPath: assetsDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\assets" "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\assets"
@ -86,8 +86,8 @@ describe("js replacer - vite", () => {
"index-XwzrZ5Gu.js", "index-XwzrZ5Gu.js",
"keycloakify-logo-mqjydaoZ.png" "keycloakify-logo-mqjydaoZ.png"
], ],
buildOptions: { buildContext: {
reactAppBuildDirPath, projectBuildDirPath,
assetsDirPath, assetsDirPath,
urlPathname: undefined urlPathname: undefined
}, },
@ -124,15 +124,15 @@ describe("js replacer - vite", () => {
} }
`; `;
for (const { reactAppBuildDirPath, assetsDirPath, systemType } of [ for (const { projectBuildDirPath, assetsDirPath, systemType } of [
{ {
systemType: "posix", systemType: "posix",
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/dist", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/dist",
assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/foo/bar" assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/foo/bar"
}, },
{ {
systemType: "win32", systemType: "win32",
reactAppBuildDirPath: projectBuildDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist", "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist",
assetsDirPath: assetsDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\foo\\bar" "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\foo\\bar"
@ -145,8 +145,8 @@ describe("js replacer - vite", () => {
"index-XwzrZ5Gu.js", "index-XwzrZ5Gu.js",
"keycloakify-logo-mqjydaoZ.png" "keycloakify-logo-mqjydaoZ.png"
], ],
buildOptions: { buildContext: {
reactAppBuildDirPath, projectBuildDirPath,
assetsDirPath, assetsDirPath,
urlPathname: undefined urlPathname: undefined
}, },
@ -183,15 +183,15 @@ describe("js replacer - vite", () => {
} }
`; `;
for (const { reactAppBuildDirPath, assetsDirPath, systemType } of [ for (const { projectBuildDirPath, assetsDirPath, systemType } of [
{ {
systemType: "posix", systemType: "posix",
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/dist", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/dist",
assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets" assetsDirPath: "/Users/someone/github/keycloakify-starter/dist/assets"
}, },
{ {
systemType: "win32", systemType: "win32",
reactAppBuildDirPath: projectBuildDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist", "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist",
assetsDirPath: assetsDirPath:
"C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\assets" "C:\\\\Users\\someone\\github\\keycloakify-starter\\dist\\assets"
@ -204,8 +204,8 @@ describe("js replacer - vite", () => {
"index-XwzrZ5Gu.js", "index-XwzrZ5Gu.js",
"keycloakify-logo-mqjydaoZ.png" "keycloakify-logo-mqjydaoZ.png"
], ],
buildOptions: { buildContext: {
reactAppBuildDirPath, projectBuildDirPath,
assetsDirPath, assetsDirPath,
urlPathname: "/foo-bar-baz/" urlPathname: "/foo-bar-baz/"
}, },
@ -266,8 +266,8 @@ describe("js replacer - webpack", () => {
const { fixedJsCode } = replaceImportsInJsCode_webpack({ const { fixedJsCode } = replaceImportsInJsCode_webpack({
jsCode: jsCodeUntransformed, jsCode: jsCodeUntransformed,
buildOptions: { buildContext: {
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/build", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/build",
assetsDirPath: "/Users/someone/github/keycloakify-starter/build/static", assetsDirPath: "/Users/someone/github/keycloakify-starter/build/static",
urlPathname: undefined urlPathname: undefined
} }
@ -353,8 +353,8 @@ describe("js replacer - webpack", () => {
const { fixedJsCode } = replaceImportsInJsCode_webpack({ const { fixedJsCode } = replaceImportsInJsCode_webpack({
jsCode: jsCodeUntransformed, jsCode: jsCodeUntransformed,
buildOptions: { buildContext: {
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/build", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/build",
assetsDirPath: "/Users/someone/github/keycloakify-starter/build/static", assetsDirPath: "/Users/someone/github/keycloakify-starter/build/static",
urlPathname: "/foo-bar/" urlPathname: "/foo-bar/"
} }
@ -373,8 +373,8 @@ describe("js replacer - webpack", () => {
const { fixedJsCode } = replaceImportsInJsCode_webpack({ const { fixedJsCode } = replaceImportsInJsCode_webpack({
jsCode: jsCodeUntransformed, jsCode: jsCodeUntransformed,
buildOptions: { buildContext: {
reactAppBuildDirPath: "/Users/someone/github/keycloakify-starter/build", projectBuildDirPath: "/Users/someone/github/keycloakify-starter/build",
assetsDirPath: assetsDirPath:
"/Users/someone/github/keycloakify-starter/dist/build/static", "/Users/someone/github/keycloakify-starter/dist/build/static",
urlPathname: "/foo/bar/" urlPathname: "/foo/bar/"
@ -430,7 +430,7 @@ describe("css replacer", () => {
const { cssCodeToPrependInHead } = generateCssCodeToDefineGlobals({ const { cssCodeToPrependInHead } = generateCssCodeToDefineGlobals({
cssGlobalsToDefine, cssGlobalsToDefine,
buildOptions: { buildContext: {
urlPathname: undefined urlPathname: undefined
} }
}); });
@ -488,7 +488,7 @@ describe("css replacer", () => {
const { cssCodeToPrependInHead } = generateCssCodeToDefineGlobals({ const { cssCodeToPrependInHead } = generateCssCodeToDefineGlobals({
cssGlobalsToDefine, cssGlobalsToDefine,
buildOptions: { buildContext: {
urlPathname: "/x/y/z/" urlPathname: "/x/y/z/"
} }
}); });
@ -541,7 +541,7 @@ describe("inline css replacer", () => {
it("transforms css for standalone app properly", () => { it("transforms css for standalone app properly", () => {
const { fixedCssCode } = replaceImportsInInlineCssCode({ const { fixedCssCode } = replaceImportsInInlineCssCode({
cssCode, cssCode,
buildOptions: { buildContext: {
urlPathname: undefined urlPathname: undefined
} }
}); });
@ -619,7 +619,7 @@ describe("inline css replacer", () => {
it("transforms css for standalone app properly", () => { it("transforms css for standalone app properly", () => {
const { fixedCssCode } = replaceImportsInInlineCssCode({ const { fixedCssCode } = replaceImportsInInlineCssCode({
cssCode, cssCode,
buildOptions: { buildContext: {
urlPathname: "/x/y/z/" urlPathname: "/x/y/z/"
} }
}); });