Repository: jamesramsay/hercule
Pull request #193 (2016-03-11 11:05:45)

Test: add ava linting


Patch:
diff --git a/.eslintrc.json b/.eslintrc.json
index cb8a798..e7e8259 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -3,9 +3,25 @@
     "node": true
   },
   "extends": "airbnb/base",
+  "plugins": [
+    "ava"
+  ],
   "rules": {
     "id-length": [2, {"min": 2, "max": 25, "properties": "never", "exceptions": ["_"]}],
     "max-len": [1, 120, 2],
-    "no-cond-assign": [2, "except-parens"]
+    "no-cond-assign": [2, "except-parens"],
+    "ava/max-asserts": [2, 5],
+    "ava/no-cb-test": 0,
+    "ava/no-identical-title": 2,
+    "ava/no-invalid-end": 2,
+    "ava/no-only-test": 2,
+    "ava/no-skip-assert": 2,
+    "ava/no-skip-test": 2,
+    "ava/no-todo-test": 1,
+    "ava/prefer-power-assert": 0,
+    "ava/test-ended": 2,
+    "ava/test-title": [2, "always"],
+    "ava/use-t": 2,
+    "ava/use-test": 2
   }
 }
diff --git a/package.json b/package.json
index c1dbc6e..d088d82 100644
--- a/package.json
+++ b/package.json
@@ -70,6 +70,7 @@
     "codecov.io": "^0.1.6",
     "eslint": "^2.2.0",
     "eslint-config-airbnb": "^6.0.1",
+    "eslint-plugin-ava": "^1.2.0",
     "istanbul": "^0.4.1",
     "nock": "^7.0.2",
     "nyc": "^6.0.0",


Test patch:
diff --git a/test/integration/transcludeFileSync.js b/test/integration/transcludeFileSync.js
index c3e860e..ba2bc47 100644
--- a/test/integration/transcludeFileSync.js
+++ b/test/integration/transcludeFileSync.js
@@ -10,12 +10,13 @@ import fixtures from '../fixtures';
 const [major, minor] = process.versions.node.split('.');
 
 if (major < 1 && minor < 12) {
+  // eslint-disable-next-line ava/no-only-test
   test.only('synchronous support not available < 0.12', (t) => {
     t.pass();
   });
 }
 
-test.beforeEach((t) => {
+test.beforeEach('prepare log monitor', (t) => {
   t.context.logOutput = [];
   t.context.logStream = through2.obj();
 
diff --git a/test/integration/transcludeStream.js b/test/integration/transcludeStream.js
index ceeaa4d..a197952 100644
--- a/test/integration/transcludeStream.js
+++ b/test/integration/transcludeStream.js
@@ -10,7 +10,7 @@ import fixtures from '../fixtures';
 import './_mock';
 
 
-test.beforeEach((t) => {
+test.beforeEach('prepare log monitor', (t) => {
   t.context.logOutput = [];
   t.context.logStream = through2.obj();
 
diff --git a/test/integration/transcludeStringSync.js b/test/integration/transcludeStringSync.js
index 957967b..f6c312b 100644
--- a/test/integration/transcludeStringSync.js
+++ b/test/integration/transcludeStringSync.js
@@ -10,12 +10,13 @@ import fixtures from '../fixtures';
 const [major, minor] = process.versions.node.split('.');
 
 if (major < 1 && minor < 12) {
+  // eslint-disable-next-line ava/no-only-test
   test.only('synchronous support not available < 0.12', (t) => {
     t.pass();
   });
 }
 
-test.beforeEach((t) => {
+test.beforeEach('prepare log monitor', (t) => {
   t.context.logOutput = [];
   t.context.logStream = through2.obj();
 
diff --git a/test/units/transcludeFileSync.js b/test/units/transcludeFileSync.js
index 5a55bd8..197a4e6 100644
--- a/test/units/transcludeFileSync.js
+++ b/test/units/transcludeFileSync.js
@@ -6,6 +6,7 @@ import { transcludeFileSync } from '../../lib/hercule';
 const [major, minor] = process.versions.node.split('.');
 
 if (major < 1 && minor < 12) {
+  // eslint-disable-next-line ava/no-only-test
   test.only('synchronous support not available < 0.12', (t) => {
     t.pass();
   });
diff --git a/test/units/transcludeStringSync.js b/test/units/transcludeStringSync.js
index e6f63c1..c3fa7a5 100644
--- a/test/units/transcludeStringSync.js
+++ b/test/units/transcludeStringSync.js
@@ -5,6 +5,7 @@ import { transcludeStringSync } from '../../lib/hercule';
 const [major, minor] = process.versions.node.split('.');
 
 if (major < 1 && minor < 12) {
+  // eslint-disable-next-line ava/no-only-test
   test.only('synchronous support not available < 0.12', (t) => {
     t.pass();
   });