Skip to content

Commit

Permalink
improve test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Sep 28, 2024
1 parent f518ae1 commit ca6e48b
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/fix/disable-per-line.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,39 @@ describe('disable-per-line', () => {
expect(
await tester.test({
code: [
'const foo = `',
' This is a template literal',
'`',
// eslint-disable-next-line no-template-curly-in-string
'${void 1}',
// eslint-disable-next-line no-template-curly-in-string
'${0 + void 1}',
'${',
'void 1',
'}',
// eslint-disable-next-line no-template-curly-in-string
'${`${void 1}`}',
'`;',
// MEMO: Code that includes indents can be fixed, but it will not be formatted prettily. This is a limitation of eslint-interactive.
'const withIndent = `',
// eslint-disable-next-line no-template-curly-in-string
' ${void 1}',
'`;',
],
rules: { 'no-void': 'error' },
}),
).toMatchInlineSnapshot(`
"const foo = \`
This is a template literal
"\`
\${// eslint-disable-next-line no-void
void 1}
\${// eslint-disable-next-line no-void
0 + void 1}
\${
// eslint-disable-next-line no-void
void 1
}
\${\`\${// eslint-disable-next-line no-void
void 1}\`}
\`;
const withIndent = \`
\${ // eslint-disable-next-line no-void
void 1}
\`;"
Expand Down

0 comments on commit ca6e48b

Please sign in to comment.