Run npm install
then gulp && karma start
to try out the tests.
Last active
August 29, 2015 14:25
-
-
Save brianmhunt/e9b54d35af5c6537e3c8 to your computer and use it in GitHub Desktop.
MWE re. karma-browserify#137
This file contains hidden or 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
gulp = require('gulp') | |
browserify = require('browserify') | |
source = require('vinyl-source-stream') | |
gulp.task('default', function () { | |
var bify = browserify({ | |
entries: './source.js', | |
debug: true | |
}) | |
.transform(require('babelify')) | |
.bundle() | |
.pipe(source("./dest.js")) | |
.pipe(gulp.dest('./')) | |
}) |
This file contains hidden or 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
module.exports = function(config) { | |
config.set({ | |
basePath: '', | |
frameworks: ['mocha', 'chai'], | |
files: [ 'dest.js' ], | |
exclude: [ ], | |
preprocessors: { }, | |
reporters: ['progress'], | |
port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: true, | |
browsers: ['Chrome'], | |
singleRun: false | |
}) | |
} |
This file contains hidden or 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": "karma-issue-1495", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"babelify": "^6.1.3", | |
"browserify": "^11.0.0", | |
"chai": "^3.2.0", | |
"gulp": "^3.9.0", | |
"karma": "^0.13.3", | |
"karma-browserify": "^4.2.1", | |
"karma-chai": "^0.1.0", | |
"karma-chrome-launcher": "^0.2.0", | |
"karma-mocha": "^0.2.0", | |
"vinyl-source-stream": "^1.1.0" | |
}, | |
"devDependencies": { | |
"karma-mocha": "^0.2.0", | |
"mocha": "^2.2.5" | |
} | |
} |
This file contains hidden or 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
// A file in es6 | |
// | |
class Foo { | |
constructor() { } | |
boo() { | |
chai.assert.equal("The line is", "7?") | |
} | |
} | |
describe('test', function () { | |
it("fails", function () { | |
new Foo().boo() | |
}) | |
it("throws", function () { | |
throw new Error("Error on Line 16") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment