]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/tests/lib/linter/node-event-generator.js
import 8.23.1 source
[pve-eslint.git] / eslint / tests / lib / linter / node-event-generator.js
index 44f8e512d6796c78854e104ac027915b9e4018d6..2719bf30e300e5ace71d9a3c1b1ede0a2c3802e2 100644 (file)
@@ -60,7 +60,7 @@ describe("NodeEventGenerator", () => {
             assert(emitter.emit.calledWith("Foo", dummyNode));
         });
 
-        it("should generate events for exitting AST node.", () => {
+        it("should generate events for exiting AST node.", () => {
             const dummyNode = { type: "Foo", value: 1 };
 
             generator.leaveNode(dummyNode);
@@ -126,7 +126,7 @@ describe("NodeEventGenerator", () => {
             it(possibleQueries.join("; "), () => {
                 const ast = espree.parse(sourceText, ESPREE_CONFIG);
                 const emissions = getEmissions(ast, possibleQueries)
-                    .filter(emission => possibleQueries.indexOf(emission[0]) !== -1);
+                    .filter(emission => possibleQueries.includes(emission[0]));
 
                 assert.deepStrictEqual(emissions, expectedEmissions(ast));
             });
@@ -388,7 +388,7 @@ describe("NodeEventGenerator", () => {
         function assertEmissions(ast, visitorKeys, possibleQueries, expectedEmissions) {
             it(possibleQueries.join("; "), () => {
                 const emissions = getEmissions(ast, visitorKeys, possibleQueries)
-                    .filter(emission => possibleQueries.indexOf(emission[0]) !== -1);
+                    .filter(emission => possibleQueries.includes(emission[0]));
 
                 assert.deepStrictEqual(emissions, expectedEmissions(ast));
             });