Skip to content

Commit 8ece1f5

Browse files
committed
test: pass no-unused-keys.test.js
1 parent 0955aa0 commit 8ece1f5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

__tests__/no-unused-keys.test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const { RuleTester } = require('eslint')
2+
const rule = require('../lib/rules/no-unused-keys')
3+
4+
const ruleTester = new RuleTester()
5+
6+
ruleTester.run('no-unused-keys', rule, {
7+
valid: [
8+
{
9+
code: 'const styles = { key: {} };',
10+
code: 'const styles = css.keyframes({ from: {}, to: {} })',
11+
code: 'const styles = css.global({ html: {}, body: {} })',
12+
code: 'const styles = css.defineThemeVars({ primary: {} })',
13+
settings: {
14+
ecmaVersion: 2021,
15+
},
16+
},
17+
],
18+
invalid: [
19+
{
20+
code: 'const styles = css.create({ key: {} });',
21+
errors: [
22+
{
23+
message: "The key 'key' is defined but never referenced anywhere.",
24+
},
25+
],
26+
settings: {
27+
ecmaVersion: 2021,
28+
},
29+
},
30+
],
31+
})

0 commit comments

Comments
 (0)