Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions tests/lib/rules/camelcase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @fileoverview Tests for camelcase rule
* @author Guy Lilian & Shahar Or
*/
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const ruleCamelcase = require("eslint/lib/rules/camelcase");
const RuleTester = require("eslint").RuleTester;

const parser = "typescript-eslint-parser";

const ruleTester = new RuleTester();

//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

ruleTester.run("camelcase", ruleCamelcase, {
valid: [
{
code: "interface Foo { b_ar: null }",
parser,
options: [{ properties: "never" }]
}
],

invalid: [
{
code: "interface Foo { b_ar: null }",
parser,
options: [{ properties: "always" }],
errors: [
{
message: "Identifier 'b_ar' is not in camel case.",
line: 1,
column: 17
}
]
}
]
});