Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac41dfa
commit f157d40
Showing
10 changed files
with
114 additions
and
151 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,11 @@ | ||
gulp = require 'gulp' | ||
coffeelint = require './helpers/coffeelint' | ||
coverage = require './helpers/coverage' | ||
mochaPhantomjs = require './helpers/mocha-phantomjs' | ||
rename = require './helpers/rename' | ||
browserify = require './helpers/browserify' | ||
umd = require './helpers/umd' | ||
karma = require 'karma' | ||
|
||
compileTest = -> | ||
gulp.src 'test/simple-module.coffee' | ||
.pipe coffeelint() | ||
.pipe browserify() | ||
.pipe rename | ||
suffix: '-test' | ||
.pipe gulp.dest('test/runner') | ||
compileTest.displayName = 'compile-test' | ||
|
||
compileSrc = (done) -> | ||
gulp.src 'src/simple-module.coffee' | ||
.pipe coffeelint() | ||
.pipe coverage() | ||
.pipe gulp.dest('test/runner') | ||
.on 'end', -> | ||
gulp.src 'test/runner/simple-module.js' | ||
.pipe browserify() | ||
.pipe umd() | ||
.pipe gulp.dest('test/runner') | ||
.on 'end', -> | ||
done() | ||
compileSrc.displayName = 'compile-src' | ||
|
||
test = gulp.parallel compileSrc, compileTest, (done) -> | ||
mochaPhantomjs 'test/runner/index.html', done | ||
test = (done) -> | ||
server = new karma.Server | ||
configFile: "#{process.cwd()}/karma.coffee" | ||
, done | ||
server.start() | ||
|
||
gulp.task 'test', test | ||
module.exports = 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
coveragify = require 'browserify-coffee-coverage' | ||
|
||
module.exports = (config) -> | ||
config.set | ||
|
||
# base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '' | ||
|
||
|
||
# frameworks to use | ||
# available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['browserify', 'mocha', 'chai'] | ||
|
||
|
||
# list of files / patterns to load in the browser | ||
files: [ | ||
'node_modules/jquery/dist/jquery.js' | ||
'src/simple-module.coffee', | ||
'test/simple-module.coffee' | ||
] | ||
|
||
|
||
# list of files to exclude | ||
exclude: [ | ||
] | ||
|
||
|
||
# preprocess matching files before serving them to the browser | ||
# available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: | ||
'src/simple-module.coffee': ['browserify'] | ||
'test/simple-module.coffee': ['browserify'] | ||
|
||
|
||
browserify: | ||
transform: [coveragify] | ||
extensions: ['.js', '.coffee'] | ||
|
||
|
||
coverageReporter: | ||
dir: 'coverage' | ||
subdir: '.' | ||
reporters: [ | ||
{ type: 'lcovonly' } | ||
{ type: 'text-summary' } | ||
] | ||
|
||
# test results reporter to use | ||
# possible values: 'dots', 'progress' | ||
# available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['coverage', 'dots'] | ||
|
||
|
||
# web server port | ||
port: 9876 | ||
|
||
|
||
# enable / disable colors in the output (reporters and logs) | ||
colors: true | ||
|
||
|
||
# level of logging | ||
# possible values: | ||
# - config.LOG_DISABLE | ||
# - config.LOG_ERROR | ||
# - config.LOG_WARN | ||
# - config.LOG_INFO | ||
# - config.LOG_DEBUG | ||
logLevel: config.LOG_INFO | ||
|
||
|
||
# enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: false | ||
|
||
|
||
# start these browsers | ||
# available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'] | ||
|
||
|
||
# Continuous Integration mode | ||
# if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true | ||
|
||
# Concurrency level | ||
# how many browser should be started simultaneous | ||
concurrency: Infinity |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SimpleModule = require '../src/simple-module' | ||
expect = chai.expect | ||
|
||
describe 'SimpleModule', -> | ||
|