Skip to content

Commit 0fc4a23

Browse files
committed
test: avoid newline-specific assertions in formatting e2e test
Avoid hardcoding LF (`\n`) line endings in `formatting.ts` assertions so the test passes on Windows CI where CRLF (`\r\n`) line endings may be emitted.
1 parent cd3d30c commit 0fc4a23

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tests/e2e/tests/generate/formatting.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ export default async function () {
99
await writeFile('src/untouched.ts', untouched);
1010
await writeFile('.prettierrc', JSON.stringify({ singleQuote: true, semi: false }));
1111
await ng('generate', 'service', 'prettier-only', '--skip-tests');
12-
await expectFileToMatch('src/app/prettier-only.ts', "from '@angular/core'\n");
12+
await expectFileToMatch('src/app/prettier-only.ts', "from '@angular/core'");
1313

1414
// Distinct configurations make the selected formatter observable when both are installed.
1515
await installPackage('oxfmt');
1616
await writeFile('.oxfmtrc.json', JSON.stringify({ singleQuote: false, semi: false }));
1717
await ng('generate', 'service', 'both-formatters', '--skip-tests');
18-
await expectFileToMatch('src/app/both-formatters.ts', "from '@angular/core'\n");
18+
await expectFileToMatch('src/app/both-formatters.ts', "from '@angular/core'");
1919

2020
await uninstallPackage('prettier');
2121
await ng('generate', 'service', 'oxfmt-only', '--skip-tests');
22-
await expectFileToMatch('src/app/oxfmt-only.ts', 'from "@angular/core"\n');
22+
await expectFileToMatch('src/app/oxfmt-only.ts', 'from "@angular/core"');
2323

2424
await uninstallPackage('oxfmt');
2525
await ng('generate', 'service', 'no-formatter', '--skip-tests');
26-
await expectFileToMatch('src/app/no-formatter.ts', "from '@angular/core';\n");
26+
await expectFileToMatch('src/app/no-formatter.ts', "from '@angular/core';");
2727

2828
assert.equal(await readFile('src/untouched.ts'), untouched);
2929
} finally {

0 commit comments

Comments
 (0)