Skip to content

Commit

Permalink
Update build and test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Sep 29, 2017
1 parent 28572de commit 38f96b1
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 66 deletions.
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"presets": ["es2015", "stage-0"]
"presets": ["es2015", "stage-0"],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "trendmicro",
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
/.nyc_output
/lib
/coverage
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ node_js:
- '4'
after_success:
- npm run coveralls
- npm run coverage-clean
42 changes: 0 additions & 42 deletions gulpfile.babel.js

This file was deleted.

46 changes: 31 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gcode-interpreter",
"version": "1.2.0",
"version": "1.3.0",
"description": "G-code Interpreter",
"author": "Cheton Wu <[email protected]>",
"homepage": "https://github.com/cncjs/gcode-interpreter",
Expand All @@ -17,27 +17,43 @@
"gcode"
],
"scripts": {
"prepublish": "npm run build && npm test",
"build": "gulp",
"test": "gulp test",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --require babel-core/register -R spec",
"coverage-clean": "rm -rf ./coverage",
"prepublish": "npm run eslint && npm run build && npm test",
"eslint": "eslint src",
"build": "babel --out-dir ./lib ./src",
"test": "cross-env NODE_ENV=test nyc mocha",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
},
"main": "lib/index.js",
"dependencies": {
"gcode-parser": "^1.2.0"
"gcode-parser": "^1.3.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-cli": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-plugin-istanbul": "^4.1.5",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^3.5.0",
"coveralls": "^2.13.2",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.0",
"gulp-istanbul": "^1.1.2",
"gulp-mocha": "^4.3.1",
"mocha": "^3.5.3"
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"cross-env": "^5.0.5",
"eslint": "^4.7.2",
"eslint-config-trendmicro": "^1.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.4.0",
"mocha": "^3.5.3",
"nyc": "^11.2.1"
},
"nyc": {
"require": [
"babel-register"
],
"reporter": [
"lcov",
"text"
],
"sourceMap": false,
"instrument": false
}
}
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint no-continue: 0 */
import {
parseStream,
parseFile,
Expand Down
11 changes: 4 additions & 7 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import chai from 'chai';
import { expect } from 'chai';
import fs from 'fs';
import { GCodeInterpreter } from '../lib/';

const expect = chai.expect;
const should = chai.should();

describe('G-code Interpreter', () => {
describe('Pass a null value as the first argument', () => {
class GCodeRunner extends GCodeInterpreter {
Expand Down Expand Up @@ -41,7 +38,7 @@ describe('G-code Interpreter', () => {

runner
.loadFromFile(file, (err, results) => {
expect(err).to.be.okay;
expect(err).to.be.null;
done();
})
.on('data', (data) => {
Expand All @@ -59,7 +56,7 @@ describe('G-code Interpreter', () => {

runner
.loadFromStream(stream, (err, results) => {
expect(err).to.be.okay;
expect(err).to.be.null;
done();
})
.on('data', (data) => {
Expand All @@ -77,7 +74,7 @@ describe('G-code Interpreter', () => {

runner
.loadFromString(string, (err, results) => {
expect(err).to.be.okay;
expect(err).to.be.null;
done();
})
.on('data', (data) => {
Expand Down

0 comments on commit 38f96b1

Please sign in to comment.