Skip to content

Commit

Permalink
Add tests and travis config (#5)
Browse files Browse the repository at this point in the history
* Add tests and travis config

* Don't use yarn since arguments aren't forwarded

* v2.2.1
  • Loading branch information
dpikt authored Nov 29, 2017
1 parent 92d4c36 commit e4e498f
Show file tree
Hide file tree
Showing 5 changed files with 1,093 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- '8'
notifications:
email: false
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "@launchpadlab/eslint-config",
"version": "2.2.0",
"version": "2.2.1",
"main": "index.js",
"license": "MIT",
"author": "dpikt",
"scripts": {
"test": "jest"
},
"dependencies": {
"babel-eslint": "^8.0.2",
"eslint-import-resolver-webpack": "^0.8.3",
Expand All @@ -13,6 +16,7 @@
},
"devDependencies": {
"eslint": "^4.10.0",
"jest": "^21.2.1",
"webpack": "^3.8.1"
},
"peerDependencies": {
Expand Down
14 changes: 14 additions & 0 deletions test/all-configs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const config = require('../react-rails')
const execSync = require('child_process').execSync

// Basic sanity checks to make sure there are no syntax errors in the configs

function runConfig (config) {
execSync(`node_modules/.bin/eslint --config ${ config }.js test/test-input.js`, { stdio: 'inherit' })
}

test('index', () => runConfig('index'))
test('base', () => runConfig('base'))
test('es6', () => runConfig('es6'))
test('react', () => runConfig('react'))
test('react-rails', () => runConfig('react-rails'))
4 changes: 4 additions & 0 deletions test/test-input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function testInput () {
var thisFile = 'doesnt do anything'
return 'its just an input for the tests!'
}
Loading

0 comments on commit e4e498f

Please sign in to comment.