Skip to content

Commit 55d9d15

Browse files
two-fer: Allow coalesce (#85)
1 parent e115f6d commit 55d9d15

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/analyzers/two-fer/issue68.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { TwoFerAnalyzer } from '~src/analyzers/practice/two-fer'
2+
import { makeAnalyze } from '~test/helpers/smoke'
3+
4+
const analyze = makeAnalyze(() => new TwoFerAnalyzer())
5+
6+
describe('When running analysis on two-fer', () => {
7+
it('does not generate actionable comments when using coalesce', async () => {
8+
const solutionContent = `
9+
export const twoFer = (name) => {
10+
return \`One for \${name ?? 'you'}, one for me.\`
11+
}
12+
`.trim()
13+
14+
const output = await analyze(solutionContent)
15+
16+
expect(output.comments.length).toBe(0)
17+
})
18+
})

0 commit comments

Comments
 (0)