From cd148cb7b5719f3e2f5ed88d7f5d8cc8a1979934 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Wed, 3 Aug 2016 23:20:16 +0100 Subject: [PATCH] Ensure test results are being generated --- package.json | 1 + tests/karma.config.js | 15 +- tests/results/unit-tests.html | 420 ++++++++++++++++++++++++++++++++++ 3 files changed, 434 insertions(+), 2 deletions(-) create mode 100644 tests/results/unit-tests.html diff --git a/package.json b/package.json index f4a01e3..67d50d5 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "karma": "^1.1.0", "karma-coverage": "^1.0.0", "karma-es6-shim": "^1.0.0", + "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-phantomjs-launcher": "^1.0.1", "karma-spec-reporter": "0.0.26", diff --git a/tests/karma.config.js b/tests/karma.config.js index 5a450c0..ceebcbd 100644 --- a/tests/karma.config.js +++ b/tests/karma.config.js @@ -6,13 +6,21 @@ module.exports = function(config) { files: [ '../tests/**/*_spec.js', ], - plugins: [webpack, 'karma-jasmine', 'karma-phantomjs-launcher', 'karma-coverage', 'karma-spec-reporter', 'es6-shim'], + plugins: [ + webpack, + 'karma-jasmine', + 'karma-phantomjs-launcher', + 'karma-coverage', + 'karma-spec-reporter', + 'karma-htmlfile-reporter', + 'es6-shim' + ], browsers: ['PhantomJS'], preprocessors: { '**/*_spec.js': ['webpack'], 'src/**/*.js': ['webpack'] }, - reporters: ['spec', 'coverage'], + reporters: ['spec', 'coverage', 'html'], coverageReporter: { dir: '../tests/reports/coverage', reporters: [{ @@ -32,5 +40,8 @@ module.exports = function(config) { webpackMiddleware: { noInfo: true }, + htmlReporter: { + outputFile: 'results/unit-tests.html' + } }); }; \ No newline at end of file diff --git a/tests/results/unit-tests.html b/tests/results/unit-tests.html new file mode 100644 index 0000000..5b258b1 --- /dev/null +++ b/tests/results/unit-tests.html @@ -0,0 +1,420 @@ + + + + + Unit Test Results + + + +

Unit Test Results

+
+
+
Browser: PhantomJS 2.1.1 (Mac OS X 0.0.0)
+
Timestamp: 8/3/2016, 11:19:10 PM
+

+ 44 tests / + 0 errors / + 0 failures / + 0 skipped / + runtime: 0.099s +

+
+
+

+
+

should initialize Choices

+ should be defined +
+
Passed in 0.011s
+

+
+
+

+
+

should initialize Choices

+ should have initalised +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should not re-initialise if passed element again +
+
Passed in 0.002s
+

+
+
+

+
+

should initialize Choices

+ should have a blank state +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should have config options +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should expose public methods +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should hide passed input +
+
Passed in 0s
+

+
+
+

+
+

should initialize Choices

+ should create an outer container +
+
Passed in 0s
+

+
+
+

+
+

should initialize Choices

+ should create an inner container +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should create a choice list +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should create an item list +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should create an input +
+
Passed in 0.001s
+

+
+
+

+
+

should initialize Choices

+ should create a dropdown +
+
Passed in 0s
+

+
+
+

+
+

should handle text inputs

+ should set value via using setValue() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle text inputs

+ should accept a user inputted value +
+
Passed in 0.004s
+

+
+
+

+
+

should handle text inputs

+ should copy the passed placeholder to the cloned input +
+
Passed in 0.001s
+

+
+
+

+
+

should handle single select inputs

+ should open the choice list on focussing +
+
Passed in 0.003s
+

+
+
+

+
+

should handle single select inputs

+ should select the first choice +
+
Passed in 0.002s
+

+
+
+

+
+

should handle single select inputs

+ should highlight the choices on keydown +
+
Passed in 0.002s
+

+
+
+

+
+

should handle single select inputs

+ should select choice on enter key press +
+
Passed in 0.003s
+

+
+
+

+
+

should handle single select inputs

+ should trigger a change callback on selection +
+
Passed in 0.004s
+

+
+
+

+
+

should handle single select inputs

+ should filter choices when searching +
+
Passed in 0.004s
+

+
+
+

+
+

should handle multiple select inputs

+ should add any pre-defined values +
+
Passed in 0.002s
+

+
+
+

+
+

should handle multiple select inputs

+ should add options defined in the config + pre-defined options +
+
Passed in 0.002s
+

+
+
+

+
+

should handle multiple select inputs

+ should add a placeholder (set in config) to the search input +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle highlightItem() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle unhighlightItem() +
+
Passed in 0.003s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle highlightAll() +
+
Passed in 0.003s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle unhighlightAll() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle removeHighlightedItems() +
+
Passed in 0.005s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle showDropdown() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle hideDropdown() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle toggleDropdown() +
+
Passed in 0.001s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle hideDropdown() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle getValue() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle setValue() +
+
Passed in 0.005s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle setValueByChoice() +
+
Passed in 0.005s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle setChoices() +
+
Passed in 0.004s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle clearStore() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle disable() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle enable() +
+
Passed in 0.002s
+

+
+
+

+
+

should handle public methods on select input types

+ should handle ajax() +
+
Passed in 0.001s
+

+
+
+

+
+

should handle public methods on text input types

+ should handle clearInput() +
+
Passed in 0.001s
+

+
+
+

+
+

should handle public methods on text input types

+ should handle removeItemsByValue() +
+
Passed in 0.001s
+

+
+
+ + \ No newline at end of file