diff --git a/packages/client/ui-theme/tests/elevation-styles.client.spec.ts b/packages/client/ui-theme/tests/elevation-styles.client.spec.ts index ade17f1f06..01d704a723 100644 --- a/packages/client/ui-theme/tests/elevation-styles.client.spec.ts +++ b/packages/client/ui-theme/tests/elevation-styles.client.spec.ts @@ -113,7 +113,7 @@ describe('translucent menu surfaces pair fill and filter', () => { ] as const const files = packageStylesheets() for (const [suffix, container, background] of surfaces) { - const file = files.find(candidate => candidate.replaceAll('\\', '/').endsWith(suffix)) + const file = files.find(candidate => candidate.endsWith(suffix)) expect(file, suffix).toBeDefined() const rules = parseRules(readFileSync(file!, 'utf8')) const declarations = (selector: string) => new Map(rules diff --git a/packages/client/ui-theme/tests/stylesheet-scan.ts b/packages/client/ui-theme/tests/stylesheet-scan.ts index d91e308889..c658a21254 100644 --- a/packages/client/ui-theme/tests/stylesheet-scan.ts +++ b/packages/client/ui-theme/tests/stylesheet-scan.ts @@ -74,7 +74,8 @@ export function varReferences(value: string): string[] { /** * Every CSS file shipped as package source, excluding build output and * installed dependencies. - * @returns absolute paths of the stylesheets under packages/. + * @returns absolute stylesheet paths under packages/, `/`-separated on every + * platform so specs can match repo-relative suffixes verbatim. */ export function packageStylesheets(): string[] { const found: string[] = [] @@ -83,7 +84,7 @@ export function packageStylesheets(): string[] { const path = join(dir, entry.name) if (entry.isDirectory()) { if (entry.name !== 'node_modules' && entry.name !== 'lib' && entry.name !== 'dist') walk(path) - } else if (entry.name.endsWith('.css')) found.push(path) + } else if (entry.name.endsWith('.css')) found.push(path.replaceAll('\\', '/')) } } walk(PACKAGES_DIR)