Skip to content

Commit

Permalink
angular expected patterns fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leoortizz committed Apr 29, 2024
1 parent afc2351 commit c922e0d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions scripts/webframeworks-deploy-tests/tests.ts
Expand Up @@ -458,15 +458,14 @@ describe("webframeworks", function (this) {
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));
.map(normalize);

const EXPECTED_PATTERNS = ["", "en", "fr", "es"]
.flatMap((locale) => [
join(I18N_BASE, locale, ANGULAR_BASE_PATH, `main\.[^\.]+\.js`),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, `polyfills\.[^\.]+\.js`),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, `runtime\.[^\.]+\.js`),
join(I18N_BASE, locale, ANGULAR_BASE_PATH, `styles\.[^\.]+\.css`),
[I18N_BASE, locale, ANGULAR_BASE_PATH, `main\.[^\.]+\.js`].filter(Boolean).join(sep),
[I18N_BASE, locale, ANGULAR_BASE_PATH, `polyfills\.[^\.]+\.js`].filter(Boolean).join(sep),
[I18N_BASE, locale, ANGULAR_BASE_PATH, `runtime\.[^\.]+\.js`].filter(Boolean).join(sep),
[I18N_BASE, locale, ANGULAR_BASE_PATH, `styles\.[^\.]+\.css`].filter(Boolean).join(sep),
])
.map((it) => (it.startsWith("/") ? it.substring(1) : it))
.map((it) => new RegExp(it));
Expand All @@ -484,13 +483,6 @@ describe("webframeworks", function (this) {
];

expect(unmatchedFiles, "matchedFiles").to.eql([]);
console.log({
files,
EXPECTED_FILES: EXPECTED_FILES.filter((it) => !files.includes(it)),
EXPECTED_PATTERNS: EXPECTED_PATTERNS.filter(
(it) => !files.some((file) => !!file.match(it)),
),
});
expect(unmatchedExpectations, "unmatchedExpectations").to.eql([]);
});
});
Expand Down

0 comments on commit c922e0d

Please sign in to comment.