Skip to content

Commit

Permalink
test: enhance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Sep 24, 2024
1 parent 5403778 commit 14b6968
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions tests/unit/problemData.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import { expect, test } from 'vitest';

import { generateProblem } from '../../src/problems/generateProblem';
import { problemIdToLanguageIdToProgram } from '../../src/problems/problemData';

test.each([
{
problemId: 'straight',
languageId: 'java',
},
{
problemId: 'stepBack',
languageId: 'java',
},
{
problemId: 'turnRight',
languageId: 'java',
},
{
problemId: 'turnRightAndTurnLeft',
languageId: 'java',
},
] as const)('Get a program by program and language ids', ({ languageId, problemId }) => {
expect(generateProblem(problemId, languageId, Date.now().toString())).not.toBeFalsy();
test.each(Object.keys(problemIdToLanguageIdToProgram))('Trace the program of %s', (problemId) => {
expect(generateProblem(problemId, 'java', Date.now().toString())).not.toBeFalsy();
});

0 comments on commit 14b6968

Please sign in to comment.