jest-file-snapshot:Jest匹配器可将快照写入单独的文件,而不是Jest使用的默认快照文件

时间:2021-05-25 00:37:45
【文件属性】:
文件名称:jest-file-snapshot:Jest匹配器可将快照写入单独的文件,而不是Jest使用的默认快照文件
文件大小:127KB
文件格式:ZIP
更新时间:2021-05-25 00:37:45
testing jest snapshot-testing hacktoberfest JavaScript 笑话文件快照 Jest匹配器,用于将快照写入单独的文件,而不是Jest使用的默认快照文件。 将快照写入单独的文件意味着您在输出文件中突出显示了正确的语法,并且在没有那些令人讨厌的转义字符的情况下具有更好的可读性。 如果您有二进制内容,它也很有用。 安装 npm install --save-dev jest-file-snapshot 或者 yarn add --dev jest-file-snapshot 用法 扩展Jest的expect : import { toMatchFile } from 'jest-file-snapshot' ; expect . extend ( { toMatchFile } ) ; 然后在测试中使用它: it ( 'matches content of file on disk' , ( ) => { expect ( content
【文件预览】:
jest-file-snapshot-main
----.gitignore(34B)
----.eslintrc(121B)
----package.json(2KB)
----index.js(4KB)
----tsconfig.json(662B)
----.prettierrc.json(89B)
----__tests__()
--------minimal.pdf(739B)
--------__file_snapshots__()
--------index.test.js(949B)
----.release-it.json(269B)
----__fixtures__()
--------output.md(16B)
----README.md(3KB)
----.eslintignore(15B)
----.circleci()
--------config.yml(2KB)
----yarn.lock(295KB)
----index.d.ts(604B)

网友评论