Skip to content

Commit a6ef74e

Browse files
authored
test(unbound-method): restore strict-based tests (#1883)
1 parent 2e6c3cf commit a6ef74e

1 file changed

Lines changed: 53 additions & 57 deletions

File tree

src/rules/__tests__/unbound-method.test.ts

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const ruleTester = new RuleTester({
1616
sourceType: 'module',
1717
tsconfigRootDir: rootPath,
1818
project: './tsconfig.json',
19+
disallowAutomaticSingleRunInference: true,
1920
},
2021
});
2122

@@ -89,16 +90,15 @@ const invalidTestCases: Array<TSESLint.InvalidTestCase<MessageIds, Options>> = [
8990
},
9091
],
9192
},
92-
// todo: for some reason this test is failing in CI but not locally
93-
// {
94-
// code: 'expect(Console.prototype.log).toHaveBeenCalledTimes',
95-
// errors: [
96-
// {
97-
// line: 1,
98-
// messageId: 'unboundWithoutThisAnnotation',
99-
// },
100-
// ],
101-
// },
93+
{
94+
code: 'expect(Console.prototype.log).toHaveBeenCalledTimes',
95+
errors: [
96+
{
97+
line: 1,
98+
messageId: 'unboundWithoutThisAnnotation',
99+
},
100+
],
101+
},
102102
{
103103
code: dedent`
104104
expect(() => {
@@ -502,19 +502,18 @@ Promise.resolve().then(console.log);
502502
},
503503
],
504504
},
505-
// todo: for some reason this test is failing in CI but not locally
506-
// {
507-
// code: `
508-
// import { console } from './class';
509-
// const x = console.log;
510-
// `,
511-
// errors: [
512-
// {
513-
// line: 3,
514-
// messageId: 'unboundWithoutThisAnnotation',
515-
// },
516-
// ],
517-
// },
505+
{
506+
code: `
507+
import { console } from './class';
508+
const x = console.log;
509+
`,
510+
errors: [
511+
{
512+
line: 3,
513+
messageId: 'unboundWithoutThisAnnotation',
514+
},
515+
],
516+
},
518517
{
519518
code: addContainsMethodsClass(`
520519
function foo(arg: ContainsMethods | null) {
@@ -595,17 +594,16 @@ const x = CommunicationError.prototype.foo;
595594
},
596595
],
597596
},
598-
// todo: for some reason this test is failing in CI but not locally
599-
// {
600-
// // Promise.all is not auto-bound to Promise
601-
// code: 'const x = Promise.all;',
602-
// errors: [
603-
// {
604-
// line: 1,
605-
// messageId: 'unboundWithoutThisAnnotation',
606-
// },
607-
// ],
608-
// },
597+
{
598+
// Promise.all is not auto-bound to Promise
599+
code: 'const x = Promise.all;',
600+
errors: [
601+
{
602+
line: 1,
603+
messageId: 'unboundWithoutThisAnnotation',
604+
},
605+
],
606+
},
609607
{
610608
code: `
611609
class Foo {
@@ -726,29 +724,27 @@ let foo;
726724
},
727725
],
728726
},
729-
// todo: for some reason this test is failing in CI but not locally
730-
// {
731-
// code: `
732-
// import { console } from './class';
733-
// const { log } = console;
734-
// `,
735-
// errors: [
736-
// {
737-
// line: 3,
738-
// messageId: 'unboundWithoutThisAnnotation',
739-
// },
740-
// ],
741-
// },
742-
// todo: for some reason this test is failing in CI but not locally
743-
// {
744-
// code: 'const { all } = Promise;',
745-
// errors: [
746-
// {
747-
// line: 1,
748-
// messageId: 'unboundWithoutThisAnnotation',
749-
// },
750-
// ],
751-
// },
727+
{
728+
code: `
729+
import { console } from './class';
730+
const { log } = console;
731+
`,
732+
errors: [
733+
{
734+
line: 3,
735+
messageId: 'unboundWithoutThisAnnotation',
736+
},
737+
],
738+
},
739+
{
740+
code: 'const { all } = Promise;',
741+
errors: [
742+
{
743+
line: 1,
744+
messageId: 'unboundWithoutThisAnnotation',
745+
},
746+
],
747+
},
752748
// https://github.com/typescript-eslint/typescript-eslint/issues/1866
753749
{
754750
code: `

0 commit comments

Comments
 (0)