We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ab2065 commit 3e6c875Copy full SHA for 3e6c875
creator/templates/unitTest.ts.ejs
@@ -3,9 +3,9 @@ import testCases from './testCases/<%= moduleName %>.js'
3
import { <%= leetCodeFunctionName %> } from '../src/<%= moduleName %>.js'
4
5
describe('<%= titleNumber %>. <%= titleEnglish %>', () => {
6
- testCases.forEach((testCase, index) => {
7
- test(`Test case index: ${index}, Input: ${testCase.input}`, () => {
8
- expect(<%= leetCodeFunctionName %>(testCase.input)).toEqual(testCase.expected)
+ testCases.forEach(({ input, expected }, index) => {
+ test(`Test case index: ${index}, Input: ${input}`, () => {
+ expect(<%= leetCodeFunctionName %>(input)).toEqual(expected)
9
})
10
11
0 commit comments