Skip to content

Commit f1a171f

Browse files
Merge pull request #40 from conveyal/test-standard
Require babel-eslint after all
2 parents 0907f79 + 4edf0b2 commit f1a171f

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

bin/mastarm

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ commander
9090
process.argv.push('--verbose')
9191
engine.cli(Object.assign({}, standard, {
9292
cwd: process.cwd(),
93+
eslintConfig: {
94+
parser: 'babel-eslint'
95+
},
9396
homepage: 'https://github.com/conveyal/mastarm'
9497
}))
9598
})

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"scripts": {
1313
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
14-
"test": "standard && bin/mastarm test",
14+
"test": "bin/mastarm standard && bin/mastarm test",
1515
"cover": "bin/mastarm test --coverage --coverage-paths bin"
1616
},
1717
"repository": {
@@ -33,6 +33,7 @@
3333
"dependencies": {
3434
"aws-sdk": "^2.4.2",
3535
"babel-core": "^6.10.4",
36+
"babel-eslint": "^7.0.0",
3637
"babel-jest": "^15.0.0",
3738
"babel-plugin-add-module-exports": "^0.2.1",
3839
"babel-plugin-transform-runtime": "^6.9.0",

tests/bin/mastarm.test.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ const path = require('path')
66
const mastarm = path.resolve('./bin/mastarm')
77

88
describe('mastarm cli', () => {
9-
it('help should display', (done) => {
9+
it('should display usage with no args', (done) => {
1010
exec(`node ${mastarm} --help`, (err, stdout, stderr) => {
1111
expect(err).toBeNull()
1212
expect(stdout).toContain('Usage: mastarm [options] [command]')
1313
expect(stderr).toBe('')
1414
done()
1515
})
1616
})
17+
18+
it('should run lint on a project', (done) => {
19+
exec(`node ${mastarm} lint`, (err, stdout, stderr) => {
20+
expect(err).toBeNull()
21+
expect(stdout).toBe('')
22+
expect(stderr).toBe('')
23+
done()
24+
})
25+
})
1726
})

tests/mocks/mockComponent.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {Component} from 'react'
2+
3+
export default class MockComponent extends Component {
4+
static defaultProps = {
5+
test: 'hi'
6+
}
7+
8+
render () {
9+
<div />
10+
}
11+
}

0 commit comments

Comments
 (0)