Skip to content
Prev Previous commit
Next Next commit
Eslintrc file is now yaml format (instead of JSON). tests folder incl…
…uded in eslint command.
  • Loading branch information
Scott Prue committed May 22, 2017
commit e52529c18d02edc4fe5ac2e1c49401d32ab54411
51 changes: 27 additions & 24 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"parser" : "babel-eslint",
"extends" : [
"standard",
"standard-react"
],
"plugins": [
"babel"
],
"env" : {
"browser" : true
},
"globals" : {
"__DEV__" : false,
"__PROD__" : false,
"__DEBUG__" : false,
"__COVERAGE__" : false,
"__BASENAME__" : false
},
"rules": {
"semi" : [2, "never"],
"no-console": "error"
}
}
root: true

parser: babel-eslint

extends: [standard, standard-react]
plugins: [babel, react]

env:
browser: true
es6: true
jasmine: true
node: true

ecmaFeatures:
jsx: true
modules: true

globals:
MockFirebase: true
sinon: true
Raven: true
__COVERAGE__: true
__DEV__: true

rules:
semi: [2, 'never']
no-console: 'error'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"jsnext:main": "es/index.js",
"scripts": {
"clean": "rimraf dist",
"lint": "eslint src/** test/**",
"lint": "eslint src/** tests/**",
"lint:fix": "npm run lint -- --fix",
"test": "mocha -R spec --compilers js:babel-core/register ./tests/setup.js ./tests/**/*.spec.js",
"test:cov": "istanbul cover ./node_modules/mocha/bin/_mocha -- ./tests/** --recursive --report lcov --compilers js:babel-register --require babel-polyfill",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const deleteFile = (firebase, { path, dbPath }) =>
.delete()
.then(() =>
!dbPath
? ({ path, dbPath })
? ({ path })
: firebase // Handle option for removing file info from database
.database()
.ref(dbPath)
Expand Down
1 change: 0 additions & 1 deletion tests/unit/actions/auth.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it beforeEach */
import {
dispatchLoginError,
dispatchUnauthorizedError,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/actions/query.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it beforeEach */
import queryAction from '../../../src/actions/query'
import {
watchEvent,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/actions/storage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global describe expect it beforeEach sinon */
/* eslint-disable no-unused-expressions */
import {
uploadFileWithProgress,
uploadFile,
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/compose.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it */
import { omit } from 'lodash'
import { createStore, combineReducers, compose } from 'redux'
import composeFunc, { getFirebase } from '../../src/compose'
Expand Down Expand Up @@ -119,7 +118,6 @@ describe('Compose', () => {
describe.skip('unWatchEvent', () => {
it.skip('unWatchesEvent', () =>
helpers.unWatchEvent('value', 'test')

)
})

Expand Down
1 change: 0 additions & 1 deletion tests/unit/reducer.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it */
import { fromJS } from 'immutable'
import { firebaseStateReducer } from '../../src'
import { actionTypes } from '../../src/constants'
Expand Down
1 change: 0 additions & 1 deletion tests/unit/utils/auth.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global firebase describe expect it */
import {
createAuthProvider,
getLoginMethodAndParams
Expand Down
1 change: 0 additions & 1 deletion tests/unit/utils/populate.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it beforeEach */
import {
getPopulateObj,
getPopulates,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/utils/query.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it beforeEach */
import {
getWatchPath,
setWatcher,
Expand Down
10 changes: 6 additions & 4 deletions tests/unit/utils/storage.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global describe expect it */
import { deleteFile } from '../../../src/utils/storage'
const fakeFirebase = {
_: {
Expand Down Expand Up @@ -26,8 +25,11 @@ const fakeFirebase = {
}
describe('Utils: Storage', () => {
describe('deleteFile', () => {
it('returns dbPath', () => {
expect(deleteFile(fakeFirebase, { path: 'some', dbPath: 'some' })).to.eventually.have.keys('dbPath')
})
it('returns dbPath', () =>
expect(deleteFile(fakeFirebase, { path: 'some', dbPath: 'some' })).to.eventually.have.keys(['path', 'dbPath'])
)
it('returns dbPath', () =>
expect(deleteFile(fakeFirebase, { path: 'some' })).to.eventually.have.keys('path')
)
})
})