diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..18a5ebb --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,69 @@ +// Karma configuration +// Generated on Tue Jan 10 2017 20:29:02 GMT-0800 (PST) + +module.exports = function(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: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + 'test/*Spec.js' + ], + + + // 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: { + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // 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: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Firefox'], + + + // 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 + }) +} diff --git a/package.json b/package.json index cd11a2f..3342eab 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "tape": "./node_modules/.bin/tape -r babel-register ./test/*.js", "test": "npm run eslint && npm run tape", "webpack": "./node_modules/.bin/webpack --watch", - "grunt": "./node_modules/.bin/grunt" + "grunt": "./node_modules/.bin/grunt", + "karma": "./node_modules/.bin/karma" }, "engines": { "node": ">= 0.10.0" @@ -29,6 +30,11 @@ "grunt": "^1.0.1", "grunt-contrib-uglify": "^1.0.1", "grunt-contrib-watch": "^1.0.0", + "jasmine": "^2.5.2", + "jasmine-core": "^2.5.2", + "karma": "^1.3.0", + "karma-firefox-launcher": "^1.0.0", + "karma-jasmine": "^1.1.0", "tape": "^4.5.1", "webpack": "^1.13.0" }, diff --git a/test/basicTimerSpec.js b/test/basicTimerSpec.js new file mode 100644 index 0000000..9aaf443 --- /dev/null +++ b/test/basicTimerSpec.js @@ -0,0 +1,6 @@ +describe('test fn', function() { + + it('accepts', function() { + expect(1).toEqual(1); + }) +}); \ No newline at end of file