Skip to content

Commit

Permalink
test(unbound-method): adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Mar 6, 2021
1 parent 2250013 commit c596f96
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rules/__tests__/unbound-method.test.ts
Expand Up @@ -37,7 +37,6 @@ const toThrowMatchers = [

const validTestCases: string[] = [
...[
'expect(Console.prototype.log)',
'expect(Console.prototype.log).toHaveBeenCalledTimes(1);',
'expect(Console.prototype.log).not.toHaveBeenCalled();',
'expect(Console.prototype.log).toStrictEqual(somethingElse);',
Expand All @@ -55,6 +54,19 @@ const validTestCases: string[] = [
];

const invalidTestCases: Array<TSESLint.InvalidTestCase<MessageIds, Options>> = [
{
code: dedent`
${ConsoleClassAndVariableCode}
expect(Console.prototype.log)
`,
errors: [
{
line: 9,
messageId: 'unbound',
},
],
},
{
code: 'expect(Console.prototype.log).toHaveBeenCalledTimes',
errors: [
Expand Down

0 comments on commit c596f96

Please sign in to comment.