import fs from 'fs';
import test from 'ava';
import pify from 'pify';
import index from '../';

test('Every rule is defined in index file', async t => {
  const files = await pify(fs.readdir, Promise)('../rules/');
  const rules = files.filter(file => file.indexOf('.js') === file.length - 3);

  rules.forEach(file => {
    const name = file.slice(0, -3);
    t.truthy(index.rules[name], `'${name}' is not exported in 'index.js'`);
    t.truthy(index.configs.recommended.rules[`fp/${name}`], `'${name}' is not set in the recommended config`);
  });

  t.is(Object.keys(index.rules).length, rules.length,
    'There are more exported rules than rule files.');
});

@@ -95,17 +95,17 @@
 %0A%0Atest('
-E
+e
 very rul
@@ -106,18 +106,22 @@
 ry rule 
-i
 s
+hould
  defined
@@ -124,16 +124,20 @@
 ined in 
+the 
 index fi
@@ -138,16 +138,41 @@
 dex file
+ and recommended settings
 ', async
@@ -686,12 +686,158 @@
 les.');%0A%7D);%0A
+%0Atest('no-var should be turned on in the recommended settings', async t =%3E %7B%0A  t.true(index.configs.recommended.rules%5B'no-var'%5D === 'error');%0A%7D);%0A

Add test to make sure `no-var` is in the recommended config