Skip to content

Commit

Permalink
more possible separator fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leoortizz committed Apr 26, 2024
1 parent 555ee24 commit a8ab026
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions scripts/webframeworks-deploy-tests/tests.ts
Expand Up @@ -22,6 +22,7 @@ const I18N_BASE = "";
const DEFAULT_LANG = "en";
const LOG_FILE = "firebase-debug.log";
const NEXT_SOURCE = `${__dirname}/nextjs`;
const sep = IS_WINDOWS ? `\\\\` : `\/`;

Check warning on line 25 in scripts/webframeworks-deploy-tests/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \/

async function getFilesListFromDir(dir: string): Promise<string[]> {
const files = await new Promise<string[]>((resolve, reject) => {
Expand Down Expand Up @@ -371,7 +372,6 @@ describe("webframeworks", function (this) {
.map(normalize)
.map((it) => (it.startsWith("/") ? it.substring(1) : it));

const sep = IS_WINDOWS ? `\\\\` : `\/`;
const EXPECTED_PATTERNS = [
String.raw`${NEXT_BASE_PATH}${sep}_next${sep}static${sep}chunks${sep}[^-]+-[^.]+.js`,
String.raw`${NEXT_BASE_PATH}${sep}_next${sep}static${sep}chunks${sep}app${sep}layout-[^.]+.js`,
Expand Down Expand Up @@ -452,23 +452,22 @@ describe("webframeworks", function (this) {
it("should have the expected static files to be deployed", async () => {
const EXPECTED_FILES = ["", "en", "fr", "es"]
.flatMap((locale) => [
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/index.html`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/3rdpartylicenses.txt`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/favicon.ico`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/index.original.html`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/3rdpartylicenses.txt`,
join(I18N_BASE, locale, ANGULAR_BASE_PATH, "index.html"),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, "3rdpartylicenses.txt"),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, "favicon.ico"),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, "index.original.html"),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, "3rdpartylicenses.txt"),
])
.map(normalize)
.map((it) => (it.startsWith("/") ? it.substring(1) : it));

const EXPECTED_PATTERNS = ["", "en", "fr", "es"]
.flatMap((locale) => [
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/main\.[^\.]+\.js`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/polyfills\.[^\.]+\.js`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/runtime\.[^\.]+\.js`,
`/${I18N_BASE}/${locale}/${ANGULAR_BASE_PATH}/styles\.[^\.]+\.css`,
`${I18N_BASE}${sep}${locale}${sep}${ANGULAR_BASE_PATH}${sep}main\.[^\.]+\.js`,
`${I18N_BASE}${sep}${locale}${sep}${ANGULAR_BASE_PATH}${sep}polyfills\.[^\.]+\.js`,
`${I18N_BASE}${sep}${locale}${sep}${ANGULAR_BASE_PATH}${sep}runtime\.[^\.]+\.js`,
`${I18N_BASE}${sep}${locale}${sep}${ANGULAR_BASE_PATH}${sep}styles\.[^\.]+\.css`,
])
.map(normalize)
.map((it) => (it.startsWith("/") ? it.substring(1) : it))
.map((it) => new RegExp(it.replace("/", "\\/")));

Expand Down

0 comments on commit a8ab026

Please sign in to comment.