利用 TypeScript 4.1 递归条件类型改进 Jest-each 表驱动测试类型

利用 TypeScript 4.1 中的递归条件类型,jest-each-improved-types 改进了表驱动 Jest 每次测试的类型系统。安装此包:npm install -D @wistudent/jest-each-improved-types。并在 tsconfig.json 中添加:{ "files": ["node_modules/@wistudent/jest-each-improved-types/index.d.ts"] }。使用示例:

type Variables = [ [ 'note' , string ] , [ 'given' , string ] , [ 'expected' , boolean ] ]

test . each < Variables> ` note | given | expected ${ 'true' } | ${ 'ok' }

zip
jest-each-improved-types-master.zip 预估大小:13个文件
folder
jest-each-improved-types-master 文件夹
file
.gitignore 13B
file
package.json 877B
file
example.test.ts 339B
file
package-lock.json 432KB
file
jest.config.js 6KB
file
tsconfig.json 6KB
folder
.github 文件夹
folder
workflows 文件夹
file
build-test-publish-on-version-tag copy.yml 515B
file
build-and-test-on-push.yml 337B
file
dependabot.yml 112B
file
README.md 803B
file
index.test.ts 1KB
file
babel.config.js 127B
file
index.d.ts 1KB
zip 文件大小:74.47KB