Skip to content

Commit

Permalink
test: add eslint-plugin-jest
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Jan 1, 2023
1 parent 4a796c8 commit ab18c54
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended',
],
env: {
Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/does-not-have-attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('assert.dom(...).doesNotHaveAttribute()', () => {
]);
});

test('fails for wrong content (string value)', () => {
test('fails for wrong content (boolean value)', () => {
assert.dom('input').doesNotHaveAttribute('required');
assert.dom(document.querySelector('input')).doesNotHaveAttribute('required');

Expand Down
15 changes: 0 additions & 15 deletions lib/__tests__/is-visible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ describe('assert.dom(...).isVisible()', () => {
},
]);
});

test('fails if element is missing', () => {
document.body.innerHTML = '<h1 class="baz">foo</h1>bar';

assert.dom('h2').isVisible();

expect(assert.results).toEqual([
{
actual: 'Element h2 is not visible',
expected: 'Element h2 is visible',
message: 'Element h2 is visible',
result: false,
},
]);
});
});

describe('custom messages', () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"ember-try": "2.0.0",
"eslint": "8.30.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-prettier": "4.2.1",
"jest": "27.5.1",
"lerna-changelog": "2.2.0",
Expand Down
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab18c54

Please sign in to comment.