Skip to content

Commit

Permalink
#38 isCatId のテストコードを実装
Browse files Browse the repository at this point in the history
  • Loading branch information
keitakn committed Jul 4, 2023
1 parent 2a1cee2 commit 1320590
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/features/__tests__/cats/isCatId.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable no-magic-numbers */
import { isCatId, type CatId } from '@/features';

describe('src/features/cat.ts isCatId TestCases', () => {
type TestTable = {
catId: CatId;
expected: boolean;
};

it.each`
catId
${'moko'}
`('should return true. catId: $catId', ({ catId }: TestTable) => {
expect(isCatId(catId)).toBeTruthy();
});

it.each`
catId
${'cat'}
${'unknown'}
`('should return false. catId: $catId', ({ catId }: TestTable) => {
expect(isCatId(catId)).toBeFalsy();
});
});

0 comments on commit 1320590

Please sign in to comment.