Skip to content

Commit

Permalink
Update tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze committed May 4, 2016
1 parent 79dd97e commit 6cb4bc0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion test/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('extends files', async t => {
'wyze/rules/style',
]

t.same(base.extends, expected, 'extending incorrect rules in `./base`')
t.deepEqual(base.extends, expected, 'extending incorrect rules in `./base`')
})

test('parser', async t => {
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ test('extends files', async t => {
'wyze/rules/react',
]

t.same(main.extends, expected, 'extending incorrect rules in `./index`')
t.deepEqual(main.extends, expected, 'extending incorrect rules in `./index`')
})
8 changes: 3 additions & 5 deletions test/rules/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { rules } from '../../rules/best-practices'
import test from 'ava'

test('no react rules', async t => {
for ( const rule in rules ) {
if ( rules.hasOwnProperty(rule) ) {
t.notOk(~rule.indexOf('react/'), 'found react rule in undesired file')
}
}
Object.keys(rules).forEach(rule => {
t.falsy(~rule.indexOf('react/'), 'found react rule in undesired file')
})
})
10 changes: 4 additions & 6 deletions test/rules/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { parserOptions, rules } from '../../rules/es6'
import test from 'ava'

test('no react rules', async t => {
for ( const rule in rules ) {
if ( rules.hasOwnProperty(rule) ) {
t.notOk(~rule.indexOf('react/'), 'found react rule in undesired file')
}
}
Object.keys(rules).forEach(rule => {
t.falsy(~rule.indexOf('react/'), 'found react rule in undesired file')
})
})

test('enable generator support', async t => {
Expand All @@ -16,5 +14,5 @@ test('enable generator support', async t => {
},
}

t.same(parserOptions, expected, 'parserOptions is not enabling generators')
t.deepEqual(parserOptions, expected, 'parserOptions doesnt enable generators')
})
8 changes: 3 additions & 5 deletions test/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { rules } from '../../rules/react'
import test from 'ava'

test('only react rules', async t => {
for ( const rule in rules ) {
if ( rules.hasOwnProperty(rule) ) {
t.ok(~rule.indexOf('react/'), 'rule is not for eslint-plugin-react')
}
}
Object.keys(rules).forEach(rule => {
t.truthy(~rule.indexOf('react/'), 'rule is not for eslint-plugin-react')
})
})
8 changes: 3 additions & 5 deletions test/rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { rules } from '../../rules/style'
import test from 'ava'

test('no react rules', async t => {
for ( const rule in rules ) {
if ( rules.hasOwnProperty(rule) ) {
t.notOk(~rule.indexOf('react/'), 'found react rule in undesired file')
}
}
Object.keys(rules).forEach(rule => {
t.falsy(~rule.indexOf('react/'), 'found react rule in undesired file')
})
})
8 changes: 3 additions & 5 deletions test/rules/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { rules } from '../../rules/variables'
import test from 'ava'

test('no react rules', async t => {
for ( const rule in rules ) {
if ( rules.hasOwnProperty(rule) ) {
t.notOk(~rule.indexOf('react/'), 'found react rule in undesired file')
}
}
Object.keys(rules).forEach(rule => {
t.falsy(~rule.indexOf('react/'), 'found react rule in undesired file')
})
})

0 comments on commit 6cb4bc0

Please sign in to comment.