Skip to content

Commit

Permalink
Merge pull request #40 from conveyal/test-standard
Browse files Browse the repository at this point in the history
Require babel-eslint after all
  • Loading branch information
trevorgerhardt committed Sep 30, 2016
2 parents 0907f79 + 4edf0b2 commit f1a171f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bin/mastarm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ commander
process.argv.push('--verbose')
engine.cli(Object.assign({}, standard, {
cwd: process.cwd(),
eslintConfig: {
parser: 'babel-eslint'
},
homepage: 'https://github.com/conveyal/mastarm'
}))
})
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"scripts": {
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "standard && bin/mastarm test",
"test": "bin/mastarm standard && bin/mastarm test",
"cover": "bin/mastarm test --coverage --coverage-paths bin"
},
"repository": {
Expand All @@ -33,6 +33,7 @@
"dependencies": {
"aws-sdk": "^2.4.2",
"babel-core": "^6.10.4",
"babel-eslint": "^7.0.0",
"babel-jest": "^15.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.9.0",
Expand Down
11 changes: 10 additions & 1 deletion tests/bin/mastarm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ const path = require('path')
const mastarm = path.resolve('./bin/mastarm')

describe('mastarm cli', () => {
it('help should display', (done) => {
it('should display usage with no args', (done) => {
exec(`node ${mastarm} --help`, (err, stdout, stderr) => {
expect(err).toBeNull()
expect(stdout).toContain('Usage: mastarm [options] [command]')
expect(stderr).toBe('')
done()
})
})

it('should run lint on a project', (done) => {
exec(`node ${mastarm} lint`, (err, stdout, stderr) => {
expect(err).toBeNull()
expect(stdout).toBe('')
expect(stderr).toBe('')
done()
})
})
})
11 changes: 11 additions & 0 deletions tests/mocks/mockComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Component} from 'react'

export default class MockComponent extends Component {
static defaultProps = {
test: 'hi'
}

render () {
<div />
}
}

0 comments on commit f1a171f

Please sign in to comment.