Skip to content

Commit 078c406

Browse files
tests: fix ES2022 tests (mysticatea#23)
1 parent f58fef6 commit 078c406

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

test/get-function-head-location.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("The 'getFunctionHeadLocation' function", () => {
4848
"class A { static async foo() {} }": [10, 26],
4949
"class A { static get foo() {} }": [10, 24],
5050
"class A { static set foo(a) {} }": [10, 24],
51-
...(semver.gte(eslint.Linter.version, "7.0.0")
51+
...(semver.gte(eslint.Linter.version, "8.0.0")
5252
? {
5353
"class A { #foo() {} }": [10, 14],
5454
"class A { *#foo() {} }": [10, 15],
@@ -119,7 +119,7 @@ describe("The 'getFunctionHeadLocation' function", () => {
119119
{
120120
rules: { test: "error" },
121121
parserOptions: {
122-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
122+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
123123
? 2022
124124
: 2018,
125125
},

test/get-function-name-with-kind.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
6565
"class A { static get foo() {} }": "static getter 'foo'",
6666
"class A { static set foo(a) {} }": "static setter 'foo'",
6767

68-
...(semver.gte(eslint.Linter.version, "7.0.0")
68+
...(semver.gte(eslint.Linter.version, "8.0.0")
6969
? {
7070
"class A { #foo() {} }": "private method #foo",
7171
"class A { '#foo'() {} }": "method '#foo'",
@@ -139,7 +139,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
139139
const messages = linter.verify(key, {
140140
rules: { test: "error" },
141141
parserOptions: {
142-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
142+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
143143
? 2022
144144
: 2018,
145145
},
@@ -168,7 +168,7 @@ describe("The 'getFunctionNameWithKind' function", () => {
168168
const messages = linter.verify(key, {
169169
rules: { test: "error" },
170170
parserOptions: {
171-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
171+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
172172
? 2022
173173
: 2018,
174174
},

test/get-property-name.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("The 'getPropertyName' function", () => {
3434
{ code: "(class {['a' + 'b']() {}})", expected: "ab" },
3535
{ code: "(class {[tag`b`]() {}})", expected: null },
3636
{ code: "(class {[`${b}`]() {}})", expected: null }, //eslint-disable-line no-template-curly-in-string
37-
...(semver.gte(eslint.Linter.version, "7.0.0")
37+
...(semver.gte(eslint.Linter.version, "8.0.0")
3838
? [
3939
{ code: "(class { x })", expected: "x" },
4040
{ code: "(class { static x })", expected: "x" },
@@ -68,7 +68,7 @@ describe("The 'getPropertyName' function", () => {
6868
}))
6969
const messages = linter.verify(code, {
7070
parserOptions: {
71-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
71+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
7272
? 2022
7373
: 2018,
7474
},

test/get-static-value.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const aMap = Object.freeze({
241241
code: "({'a': 1, 1e+1: 2, 2n: 3})",
242242
expected: { value: { a: 1, 10: 2, 2: 3 } },
243243
},
244-
...(semver.gte(eslint.Linter.version, "7.0.0")
244+
...(semver.gte(eslint.Linter.version, "8.0.0")
245245
? [
246246
{
247247
code: `class A {
@@ -299,7 +299,7 @@ const aMap = Object.freeze({
299299
const messages = linter.verify(code, {
300300
env: { es6: true },
301301
parserOptions: {
302-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
302+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
303303
? 2022
304304
: 2020,
305305
},

test/has-side-effect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ describe("The 'hasSideEffect' function", () => {
152152
options: { considerImplicitTypeConversion: true },
153153
expected: false,
154154
},
155-
...(semver.gte(eslint.Linter.version, "7.0.0")
155+
...(semver.gte(eslint.Linter.version, "8.0.0")
156156
? [
157157
{
158158
code: "(class { x })",
@@ -318,7 +318,7 @@ describe("The 'hasSideEffect' function", () => {
318318
const messages = linter.verify(code, {
319319
env: { es6: true },
320320
parserOptions: {
321-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
321+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0")
322322
? 2022
323323
: 2020,
324324
},

test/reference-tracker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CALL, CONSTRUCT, ESM, READ, ReferenceTracker } from "../src/"
55

66
const config = {
77
parserOptions: {
8-
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0") ? 2022 : 2020,
8+
ecmaVersion: semver.gte(eslint.Linter.version, "8.0.0") ? 2022 : 2020,
99
sourceType: "module",
1010
},
1111
globals: { Reflect: false },
@@ -497,7 +497,7 @@ describe("The 'ReferenceTracker' class:", () => {
497497
},
498498
expected: [],
499499
},
500-
...(semver.gte(eslint.Linter.version, "7.0.0")
500+
...(semver.gte(eslint.Linter.version, "8.0.0")
501501
? [
502502
{
503503
description:

0 commit comments

Comments
 (0)