Skip to content

Commit 6e56a92

Browse files
committed
chore(lint): cover remaining branches in deprecated css import rule
Adds unit tests for non-import at-rules and import at-rules with no prelude, raising line coverage from 86.66% to 100% and branch coverage from 66.66% to 100%. No behavior change. Signed-off-by: Cursor Agent <cursoragent@cursor.com>
1 parent 9bb4c3f commit 6e56a92

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎projects/lint/src/eslint/rules/no-deprecated-css-imports.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,25 @@ describe('noDeprecatedCssImports', () => {
5454
});
5555
});
5656

57+
it('should ignore non-import at-rules', () => {
58+
tester.run('should ignore non-import at-rules', rule, {
59+
valid: [
60+
'@media screen { body { color: red; } }',
61+
'@charset "utf-8";',
62+
'@layer theme;',
63+
'@keyframes fade { from { opacity: 0; } to { opacity: 1; } }'
64+
],
65+
invalid: []
66+
});
67+
});
68+
69+
it('should ignore import at-rules that have no prelude', () => {
70+
tester.run('should ignore import at-rules that have no prelude', rule, {
71+
valid: ['@import;', '@import ;'],
72+
invalid: []
73+
});
74+
});
75+
5776
it('should cover CSS entrypoints documented in the migration guide', () => {
5877
expect(deprecatedImports['@maglev/elements/index.css']).toContain(
5978
`@import '@nvidia-elements/styles/view-transitions.css';`

0 commit comments

Comments
 (0)