]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/tests/lib/rules/no-fallthrough.js
import 8.41.0 source
[pve-eslint.git] / eslint / tests / lib / rules / no-fallthrough.js
index d6f6c6f93f2a1cba8baa63290fcf1b5514396792..80fa61733f349ec7254aedef58ce55b9e52afa4f 100644 (file)
@@ -63,6 +63,7 @@ ruleTester.run("no-fallthrough", rule, {
         "switch (foo) { case 0: try {} finally { break; } default: b(); }",
         "switch (foo) { case 0: try { throw 0; } catch (err) { break; } default: b(); }",
         "switch (foo) { case 0: do { throw 0; } while(a); default: b(); }",
+        "switch (foo) { case 0: a(); \n// eslint-disable-next-line no-fallthrough\n case 1: }",
         {
             code: "switch(foo) { case 0: a(); /* no break */ case 1: b(); }",
             options: [{
@@ -297,6 +298,18 @@ ruleTester.run("no-fallthrough", rule, {
                     column: 34
                 }
             ]
+        },
+        {
+            code: "switch (foo) { case 0: a(); \n// eslint-enable no-fallthrough\n case 1: }",
+            options: [{}],
+            errors: [
+                {
+                    messageId: "case",
+                    type: "SwitchCase",
+                    line: 3,
+                    column: 2
+                }
+            ]
         }
     ]
 });