Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/rules/expect-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ runRuleTester('expect-expect', rule, {
invalid: [
{
code: 'test("should fail", () => {});',
errors: [{ messageId: 'noAssertions' }],
errors: [{ messageId: 'noAssertions', type: 'Identifier', }],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

},
{
code: 'test.skip("should fail", () => {});',
errors: [{ messageId: 'noAssertions' }],
errors: [{ messageId: 'noAssertions', type: 'MemberExpression' }],
},
{
code: javascript`
test('should fail', async ({ page }) => {
await assertCustomCondition(page)
})
`,
errors: [{ messageId: 'noAssertions' }],
errors: [{ messageId: 'noAssertions', type: 'Identifier' }],
},
{
code: javascript`
test('should fail', async ({ page }) => {
await assertCustomCondition(page)
})
`,
errors: [{ messageId: 'noAssertions' }],
errors: [{ messageId: 'noAssertions', type: 'Identifier' }],
name: 'Custom assert function',
options: [{ assertFunctionNames: ['wayComplexCustomCondition'] }],
},
{
code: 'it("should pass", () => hi(true).toBeDefined())',
errors: [{ messageId: 'noAssertions' }],
errors: [{ messageId: 'noAssertions', type: 'Identifier' }],
name: 'Global aliases',
settings: {
playwright: {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/expect-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default createRule({
},
'Program:exit'() {
unchecked.forEach((node) => {
context.report({ messageId: 'noAssertions', node })
context.report({ messageId: 'noAssertions', node: node.callee })
})
},
}
Expand Down
Loading