chore: enable eslint-plugin-jest (#6375)

This commit is contained in:
Joshua Chen 2022-01-16 15:53:23 +08:00 committed by GitHub
parent 3e5944ef1f
commit 52db7320a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 194 additions and 193 deletions

View file

@ -41,6 +41,7 @@ function testField(params: {
params.invalidFrontMatters?.forEach(([frontMatter, message]) => {
try {
validateDocFrontMatter(frontMatter);
// eslint-disable-next-line jest/no-jasmine-globals
fail(
new Error(
`Doc frontmatter is expected to be rejected, but was accepted successfully:\n ${JSON.stringify(
@ -51,6 +52,7 @@ function testField(params: {
),
);
} catch (e) {
// eslint-disable-next-line jest/no-conditional-expect
expect(e.message).toMatch(new RegExp(escapeStringRegexp(message)));
}
});