Last active
March 28, 2017 13:03
-
-
Save duereg/8e398f05e962af0965053d8ddf827165 to your computer and use it in GitHub Desktop.
Node 6.10.1 test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sourceMap": true, | |
"presets": ["es2015-node6"], | |
"plugins": ["add-module-exports", "transform-object-rest-spread"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DEFAULT_FLAGS = [1]; | |
export default function brokenNodeTest() { | |
const query = { | |
flags: true ? | |
[...DEFAULT_FLAGS, 2] : | |
DEFAULT_FLAGS | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import assert from 'assert'; | |
import brokenNodeTest from './brokenNodeTest'; | |
describe.only('broken node test', () => { | |
let results; | |
describe('this should not explode', () => { | |
beforeEach(() => { | |
results = brokenNodeTest(); | |
}); | |
it('no explode', () => { | |
assert(true); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import istanbul from 'gulp-istanbul'; | |
import {Instrumenter} from 'isparta'; | |
import mocha from 'gulp-mocha'; | |
function runTestsWithCoverage(cb) { | |
return gulp.src(['./brokenNodeTest.js']) | |
.pipe(istanbul({ // Covering files | |
instrumenter: Instrumenter, | |
includeUntested: true | |
})) | |
.pipe(istanbul.hookRequire()) // Force `require` to return covered files | |
.on('finish', function finish() { | |
gulp.src(["./brokenNodeTest.spec.js"], {read: false}) | |
.pipe(mocha({reporter: 'spec', timeout: 15000})) | |
.pipe(istanbul.writeReports({ | |
dir: "coverage", | |
reportOpts: {dir: "coverage"}, | |
reporters: ['text', 'text-summary', 'json', 'html'] | |
})) | |
.on('end', console.error) | |
.on('error', console.error); | |
}); | |
} | |
gulp.task('unit-test', runTestsWithCoverage); | |
gulp.task('default', ['unit-test']); | |
gulp.task('test', ['unit-test']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "make-v8-great-again", | |
"version": "1.0.0", | |
"description": "Make V8 go boom!", | |
"dependencies": { | |
"babel-plugin-add-module-exports": "^0.1.2", | |
"babel-plugin-transform-object-rest-spread": "^6.3.13", | |
"babel-preset-es2015-node6": "^0.3.0", | |
"babel-register": "^6.3.13", | |
"gulp": "^3.9.0", | |
"gulp-istanbul": "duereg/gulp-istanbul#143c0bad", | |
"gulp-mocha": "^2.0.1", | |
"isparta": "^4.0.0" | |
}, | |
"engines": { | |
"node": "6.10.1", | |
"npm": "^4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
btw I'd recommend using https://github.com/babel/babel-preset-env/ instead