Skip to content

Commit b8d120d

Browse files
committed
test(unbound-method): don't run broken test when using @typescript-eslint v5
1 parent b709f7e commit b8d120d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'path';
2+
import { version as rawTypeScriptESLintPluginVersion } from '@typescript-eslint/eslint-plugin/package.json';
23
import { TSESLint } from '@typescript-eslint/utils';
34
import dedent from 'dedent';
45
import type { MessageIds, Options } from '../unbound-method';
@@ -252,7 +253,9 @@ ruleTester.run('unbound-method', requireRule(false), {
252253
"['1', '2', '3'].map(Number.parseInt);",
253254
'[5.2, 7.1, 3.6].map(Math.floor);',
254255
'const x = console.log;',
255-
'const x = Object.defineProperty;',
256+
...(parseInt(rawTypeScriptESLintPluginVersion.split('.')[0], 10) >= 6
257+
? ['const x = Object.defineProperty;']
258+
: []),
256259
...[
257260
'instance.bound();',
258261
'instance.unbound();',

0 commit comments

Comments
 (0)