karma-qunit 0.1.9 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,9 @@ module.exports = function (config) {
48
48
 
49
49
  // client configuration
50
50
  client: {
51
+ clearContext: false,
51
52
  qunit: {
53
+ showUI: true,
52
54
  testTimeout: 5000
53
55
  }
54
56
  }
@@ -56,6 +58,8 @@ module.exports = function (config) {
56
58
  }
57
59
  ```
58
60
 
61
+ Note: `showUI: true` needs the `clearContext: false` option to display correctly in non-debug mode.
62
+
59
63
  ----
60
64
 
61
65
  For more information on Karma see the [homepage]. If you're using `karma-qunit` to test Ember.js, you might find Karma's [Ember guide](http://karma-runner.github.io/0.12/plus/emberjs.html) helpful.
package/lib/adapter.js CHANGED
@@ -22,6 +22,13 @@ function createQUnitStartFn (tc, runnerPassedIn) { // eslint-disable-line no-unu
22
22
  var timer = null
23
23
  var testResult = {}
24
24
  var supportsTestTracking = false
25
+ var config = (tc.config && tc.config.qunit) || {}
26
+
27
+ if (config.showUI) {
28
+ var ui = document.createElement('div')
29
+ ui.id = 'qunit'
30
+ document.body.appendChild(ui)
31
+ }
25
32
 
26
33
  if (runner.begin) {
27
34
  runner.begin(function (args) {
@@ -93,10 +100,15 @@ function createQUnitStartFn (tc, runnerPassedIn) { // eslint-disable-line no-unu
93
100
  description: test.name,
94
101
  suite: test.module && [test.module] || [],
95
102
  success: testResult.success,
103
+ skipped: test.skipped,
96
104
  log: testResult.errors || [],
97
105
  time: new Date().getTime() - timer
98
106
  }
99
107
 
108
+ if (result.description.indexOf('global failure') !== -1) {
109
+ return
110
+ }
111
+
100
112
  tc.result(result)
101
113
  })
102
114
 
package/lib/index.js CHANGED
@@ -1,18 +1,23 @@
1
- function createPattern (path) {
1
+ var path = require('path')
2
+
3
+ function createPattern (pattern) {
2
4
  return {
3
- pattern: path,
5
+ pattern: pattern,
4
6
  included: true,
5
7
  served: true,
6
8
  watched: false
7
9
  }
8
10
  }
9
11
 
10
- function initQUnit (files) {
11
- files.unshift(createPattern(__dirname + '/adapter.js'))
12
+ function initQUnit (files, qunit) {
13
+ files.unshift(createPattern(path.join(__dirname, 'adapter.js')))
12
14
  files.unshift(createPattern(require.resolve('qunitjs')))
15
+ if (qunit && qunit.showUI) {
16
+ files.unshift(createPattern(require.resolve('qunitjs/qunit/qunit.css')))
17
+ }
13
18
  }
14
19
 
15
- initQUnit.$inject = ['config.files']
20
+ initQUnit.$inject = ['config.files', 'config.client.qunit']
16
21
 
17
22
  module.exports = {
18
23
  'framework:qunit': ['factory', initQUnit]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karma-qunit",
3
- "version": "0.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "A Karma plugin. Adapter for QUnit testing framework.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -22,40 +22,46 @@
22
22
  "author": "Vojta Jina <vojta.jina@gmail.com>",
23
23
  "dependencies": {},
24
24
  "devDependencies": {
25
- "eslint": "^0.24.1",
26
- "eslint-config-standard": "^3.4.1",
27
- "grunt": "^0.4.5",
28
- "grunt-bump": "^0.3.1",
29
- "grunt-eslint": "^16.0.0",
30
- "grunt-karma": "^0.12.0",
25
+ "eslint": "^2.13.1",
26
+ "eslint-config-standard": "^5.3.1",
27
+ "eslint-plugin-promise": "^1.3.2",
28
+ "eslint-plugin-standard": "^1.3.2",
29
+ "grunt": "^1.0.1",
30
+ "grunt-bump": "^0.8.0",
31
+ "grunt-eslint": "^18.1.0",
32
+ "grunt-karma": "2.x",
31
33
  "grunt-npm": "0.0.2",
32
34
  "jasmine-core": "^2.3.4",
33
- "karma": "^0.13.3",
34
- "karma-chrome-launcher": "^0.2.0",
35
- "karma-firefox-launcher": "^0.1.6",
36
- "karma-jasmine": "^0.3.6",
35
+ "karma": "1.x || ^0.13.3",
36
+ "karma-chrome-launcher": "1.x || ^0.2.0",
37
+ "karma-firefox-launcher": "1.x || ^0.1.6",
38
+ "karma-jasmine": "1.x || ^0.3.6",
37
39
  "load-grunt-tasks": "^3.2.0",
38
- "qunitjs": "^1.18.0"
40
+ "qunitjs": "^2.0.0"
39
41
  },
40
42
  "peerDependencies": {
41
- "qunitjs": "^1.14.0"
43
+ "qunitjs": "^1.14.0 || ^2.0.0"
42
44
  },
43
45
  "license": "MIT",
44
46
  "contributors": [
45
- "dignifiedquire <dignifiedquire@gmail.com>",
46
47
  "Friedel Ziegelmayer <dignifiedquire@gmail.com>",
48
+ "dignifiedquire <dignifiedquire@gmail.com>",
47
49
  "Matt DuVall <matt@stripe.com>",
50
+ "Mark Ethan Trostler <mark@zzo.com>",
51
+ "Stefan Sechelmann <stefan@sechel.de>",
52
+ "masubi <justin.masui@gmail.com>",
48
53
  "Friedel Ziegelmayer <friedel.ziegelmayer@gmail.com>",
49
54
  "Aymeric Beaumet <aymeric@beaumet.me>",
50
- "Stefan Dragnev <dragnev@telerik.com>",
51
- "Tim Robertson <trobertson@spredfast.com>",
52
- "Timo Tijhof <krinklemail@gmail.com>",
53
- "Aymeric Beaumet <aymeric.beaumet@gmail.com>",
55
+ "masubi <masubi@users.noreply.github.com>",
54
56
  "thenickcox <nick@nickcox.me>",
55
57
  "Brian Donovan <donovan@squareup.com>",
56
58
  "Daniel Herman <daniel.c.herman@gmail.com>",
57
59
  "Kristof Neirynck <k.neirynck@gmail.com>",
58
60
  "Marcin Szczepanski <mszczepanski@atlassian.com>",
59
- "Sahat Yalkabov <sakhat@gmail.com>"
61
+ "Sahat Yalkabov <sakhat@gmail.com>",
62
+ "Stefan Dragnev <dragnev@telerik.com>",
63
+ "Tim Robertson <trobertson@spredfast.com>",
64
+ "Timo Tijhof <krinklemail@gmail.com>",
65
+ "Aymeric Beaumet <aymeric.beaumet@gmail.com>"
60
66
  ]
61
67
  }