Skip to content

Commit

Permalink
chore: add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
holazz committed May 26, 2022
1 parent 45432cd commit 49c859e
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions packages/eslint-plugin/tests/rules/space-infix-ops.test.ts
Expand Up @@ -997,6 +997,96 @@ ruleTester.run('space-infix-ops', rule, {
},
],
},
{
code: `
type Test<T> = T extends boolean? true :false
`,
output: `
type Test<T> = T extends boolean ? true : false
`,
errors: [
{
messageId: 'missingSpace',
column: 41,
line: 2,
},
{
messageId: 'missingSpace',
column: 48,
line: 2,
},
],
},
{
code: `
type Test<T> = T extends boolean?
true :false
`,
output: `
type Test<T> = T extends boolean ?
true : false
`,
errors: [
{
messageId: 'missingSpace',
column: 41,
line: 2,
},
{
messageId: 'missingSpace',
column: 16,
line: 3,
},
],
},
{
code: `
type Test<T> = T extends boolean?
true
:false
`,
output: `
type Test<T> = T extends boolean ?
true
: false
`,
errors: [
{
messageId: 'missingSpace',
column: 41,
line: 2,
},
{
messageId: 'missingSpace',
column: 11,
line: 4,
},
],
},
{
code: `
type Test<T> = T extends boolean
?true:
false
`,
output: `
type Test<T> = T extends boolean
? true :
false
`,
errors: [
{
messageId: 'missingSpace',
column: 11,
line: 3,
},
{
messageId: 'missingSpace',
column: 16,
line: 3,
},
],
},
{
code: `
interface Test {
Expand Down

0 comments on commit 49c859e

Please sign in to comment.