]> git.proxmox.com Git - pve-eslint.git/blame - eslint/tests/tools/internal-rules/multiline-comment-style.js
import 8.3.0 source
[pve-eslint.git] / eslint / tests / tools / internal-rules / multiline-comment-style.js
CommitLineData
eb39fafa
DC
1"use strict";
2
609c276f
TL
3//------------------------------------------------------------------------------
4// Requirements
5//------------------------------------------------------------------------------
6
eb39fafa
DC
7const rule = require("../../../tools/internal-rules/multiline-comment-style");
8const { RuleTester } = require("../../../lib/rule-tester");
609c276f
TL
9
10//------------------------------------------------------------------------------
11// Tests
12//------------------------------------------------------------------------------
13
eb39fafa
DC
14const ruleTester = new RuleTester();
15
16ruleTester.run("internal-rules/multiline-comment-style", rule, {
17 valid: [
18 `
19 //----------------
20 // Rule Description
21 //----------------
22 `,
23 `
24 /*
25 * Block comment
26 */
27 `,
28 `
29 // single-line comment
30 `
31 ],
32 invalid: [
33 {
34 code: `
35 // foo
36 // bar
37 `,
38 output: `
39 /*
40 * foo
41 * bar
42 */
43 `,
44 errors: [{ message: "Expected a block comment instead of consecutive line comments." }]
45 }
46 ]
47});