Skip to content

Commit

Permalink
Added tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
radekmie authored Jan 8, 2020
2 parents 51e940d + 6b15fb3 commit d0f2839
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 3 additions & 0 deletions jest-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"testRegex": "<rootDir>/lib/.*__tests__/.*\\.js$"
}
21 changes: 21 additions & 0 deletions lib/rules/__tests__/no-console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use strict";

var rule = require("../no-console"),
RuleTester = require("eslint").RuleTester;

var ruleTester = new RuleTester();
ruleTester.run("no-console", rule, {
valid: [
{
code: "console.info()",
options: [{disallow: ["log"]}]
}
],
invalid: [
{
code: "console.log()",
errors: [{message: /^Unexpected console statement/}],
options: [{disallow: ["log"]}]
}
]
});
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "eslint-plugin-vazco",
"version": "1.0.0",
"description": "",
"version": "1.1.0",
"description": "Custom ESLint style rules in Vazco",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest --config=jest-dev.json"
},
"devDependencies": {
"eslint": "^3.18.0",
"jest": "^19.0.1"
},
"author": "",
"license": "ISC"
Expand Down

0 comments on commit d0f2839

Please sign in to comment.