Rename test case file

This commit is contained in:
Joseph Garrone 2024-01-30 00:10:59 +01:00
parent 5b350274bd
commit f55d61bf0b
2 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import { nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../../constants";
import { assert } from "tsafe/assert";
import type { BuildOptions } from "../../BuildOptions";
import { relative as pathRelative, sep as pathSep } from "path";
import * as nodePath from "path";
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
export type BuildOptionsLike = {
@ -12,8 +12,12 @@ export type BuildOptionsLike = {
assert<BuildOptions extends BuildOptionsLike ? true : false>();
export function replaceImportsInJsCode_webpack(params: { jsCode: string; buildOptions: BuildOptionsLike }): { fixedJsCode: string } {
const { jsCode, buildOptions } = params;
export function replaceImportsInJsCode_webpack(params: { jsCode: string; buildOptions: BuildOptionsLike; systemType?: "posix" | "win32" }): {
fixedJsCode: string;
} {
const { jsCode, buildOptions, systemType = nodePath.sep === "/" ? "posix" : "win32" } = params;
const { relative: pathRelative, sep: pathSep } = nodePath[systemType];
let fixedJsCode = jsCode;

View File

@ -6,7 +6,7 @@ import { expect, it, describe } from "vitest";
import { isSameCode } from "../tools/isSameCode";
import { basenameOfTheKeycloakifyResourcesDir, nameOfTheGlobal } from "keycloakify/bin/constants";
describe("bin/js-transforms - vite", () => {
describe("js replacer - vite", () => {
it("replaceImportsInJsCode_vite - 1", () => {
const before = `Uv="modulepreload",`;
const after = `,Wc={},`;
@ -207,7 +207,7 @@ describe("bin/js-transforms - vite", () => {
});
});
describe("bin/js-transforms - webpack", () => {
describe("js replacer - webpack", () => {
const jsCodeUntransformed = `
function f() {
return a.p+"static/js/" + ({}[e] || e) + "." + {
@ -317,7 +317,7 @@ describe("bin/js-transforms - webpack", () => {
});
});
describe("bin/css-transforms", () => {
describe("css replacer", () => {
it("transforms absolute urls to css globals properly with no urlPathname", () => {
const { fixedCssCode, cssGlobalsToDefine } = replaceImportsInCssCode({
"cssCode": `
@ -432,7 +432,7 @@ describe("bin/css-transforms", () => {
});
});
describe("bin/css-inline-transforms", () => {
describe("inline css replacer", () => {
describe("no url pathName", () => {
const cssCode = `
@font-face {