Skip to content

Commit

Permalink
test(no-disabled-tests): add failing tests for error ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Oct 22, 2023
1 parent e772f8e commit f1e1549
Showing 1 changed file with 85 additions and 9 deletions.
94 changes: 85 additions & 9 deletions tests/no-disabled-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,45 +37,121 @@ ruleTester.run(RULE_NAME, rule, {
code: 'describe.skip("foo", function () {})',
errors: [
{
column: 10,
endColumn: 14,
endLine: 1,
line: 1,
messageId: 'disabledSuite'
}
]
},
{
code: 'it("contains a call to pending", function () { pending() })',
errors: [{ messageId: 'pendingTest', column: 48, line: 1 }]
errors: [
{
column: 48,
endColumn: 57,
endLine: 1,
line: 1,
messageId: 'pendingTest'
}
]
},
{
code: 'xtest("foo", function () {})',
errors: [{ messageId: 'disabledTest', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 6,
endLine: 1,
line: 1,
messageId: 'disabledTest'
}
]
},
{
code: 'xit.each``("foo", function () {})',
errors: [{ messageId: 'disabledTest', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 4,
endLine: 1,
line: 1,
messageId: 'disabledTest'
}
]
},
{
code: 'xtest.each``("foo", function () {})',
errors: [{ messageId: 'disabledTest', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 6,
endLine: 1,
line: 1,
messageId: 'disabledTest'
}
]
},
{
code: 'xit.each([])("foo", function () {})',
errors: [{ messageId: 'disabledTest', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 4,
endLine: 1,
line: 1,
messageId: 'disabledTest'
}
]
},
{
code: 'it("has title but no callback")',
errors: [{ messageId: 'missingFunction', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 32,
endLine: 1,
line: 1,
messageId: 'missingFunction'
}
]
},
{
code: 'test("has title but no callback")',
errors: [{ messageId: 'missingFunction', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 34,
endLine: 1,
line: 1,
messageId: 'missingFunction'
}
]
},
{
code: 'it("contains a call to pending", function () { pending() })',
errors: [{ messageId: 'pendingTest', column: 48, line: 1 }]
errors: [
{
column: 48,
endColumn: 57,
endLine: 1,
line: 1,
messageId: 'pendingTest'
}
]
},
{
code: 'pending();',
errors: [{ messageId: 'pending', column: 1, line: 1 }]
errors: [
{
column: 1,
endColumn: 10,
endLine: 1,
line: 1,
messageId: 'pending'
}
]
}
]
})

0 comments on commit f1e1549

Please sign in to comment.