Skip to content

Commit 15611c6

Browse files
committed
add test comments
1 parent 0904cf9 commit 15611c6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/rules/enum/enum.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const valid: PreValidTestCaseObject = {
7070
'enum U {c="T", b_="T", C="T"}',
7171
'enum U {a="T", _="T", A="T", $="T"}',
7272
"enum U {è='T', À='T', 'Z'='T', '#'='T'}",
73+
/* Non-string enums */
7374
'enum U {c, b, a}',
7475
'enum U {c=a(), b, a}',
7576
'enum U {c=0, b, a}',
@@ -110,6 +111,7 @@ const valid: PreValidTestCaseObject = {
110111

111112
const invalid: PreInvalidTestCaseObject = {
112113
ascendingWithDefaults: [
114+
/* Non-string enums */
113115
{
114116
code: 'enum U {c="123".length, b, a}',
115117
output: 'enum U {a, b, c="123".length}',

tests/rules/enum/string-enum.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import { PreInvalidTestCaseObject, PreValidTestCaseObject, runCases } from '../.
55
import { typescriptConfig } from '../../helpers/configs'
66
import { CaseCategory } from '../../helpers/strings'
77

8+
/**
9+
* This file is different from enum.spec.ts in that it:
10+
* - tests that non-string enums are ignored
11+
* - uses the deprecated rule that ignores non-string enums
12+
*
13+
* When the deprecated string-enum rule is eventually removed, this file can be too.
14+
*/
15+
816
const valid: PreValidTestCaseObject = {
917
/**
1018
* ignores

0 commit comments

Comments
 (0)