Created
July 21, 2020 10:31
-
-
Save upalexgill/49779c38c09817cf08bc1006ce1aa27f to your computer and use it in GitHub Desktop.
Karma config
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({ | |
| frameworks: ['mocha', 'chai', 'commonjs'], | |
| files: [ | |
| 'test/**/*.+(spec|test).+(js|jsx|mjs)', | |
| { pattern: 'test/**/*', included: false, served: true } | |
| ], | |
| browsers: ['Chrome'], | |
| plugins: [ | |
| 'karma-*' | |
| ], | |
| preprocessors: { | |
| 'test/**/*.+(spec|test).+(js|jsx|mjs)': ['commonjs'] | |
| }, | |
| client: { | |
| clearContext: false | |
| }, | |
| reporters: ['spec', 'html'] | |
| }) | |
| } |
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": "test", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "karma start karma.conf.js" | |
| }, | |
| "author": "", | |
| "license": "ISC", | |
| "devDependencies": { | |
| "chai": "^4.2.0", | |
| "karma": "^5.1.0", | |
| "karma-chai": "^0.1.0", | |
| "karma-chrome-launcher": "^3.1.0", | |
| "karma-commonjs": "^1.0.0", | |
| "karma-html-reporter": "^0.2.7", | |
| "karma-mocha": "^2.0.1", | |
| "karma-requirejs": "^1.1.0", | |
| "karma-spec-reporter": "0.0.32", | |
| "mocha": "^8.0.1", | |
| "requirejs": "^2.3.6" | |
| } | |
| } |
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
| describe('Array', function () { | |
| describe('#indexOf()', function () { | |
| it('should return -1 when the value is not present', function () { | |
| assert.equal([1, 2, 3].indexOf(4), -1) | |
| }) | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment