Skip to content

Commit

Permalink
✅ add tests for reference tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed May 14, 2021
1 parent d179d86 commit 0792ba6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/reference-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { CALL, CONSTRUCT, ESM, READ, ReferenceTracker } from "../src/"

const config = {
parserOptions: {
ecmaVersion: semver.gte(eslint.Linter.version, "6.0.0") ? 2020 : 2018,
ecmaVersion: semver.gte(eslint.Linter.version, "7.0.0")
? 2022
: semver.gte(eslint.Linter.version, "6.0.0")
? 2020
: 2018,
sourceType: "module",
},
globals: { Reflect: false },
Expand Down Expand Up @@ -497,6 +501,19 @@ describe("The 'ReferenceTracker' class:", () => {
},
expected: [],
},
{
description:
"should not mix up public and private identifiers.",
code: [
"class C { #value; wrap() { var value = MyObj.#value; } }",
].join("\n"),
traceMap: {
MyObj: {
value: { [READ]: 1 },
},
},
expected: [],
},
]) {
it(description, () => {
const linter = new eslint.Linter()
Expand Down

0 comments on commit 0792ba6

Please sign in to comment.