Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: karma-runner/karma
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ead31cd99238da86ab8b2d8ff5aff465959f4106
Choose a base ref
...
head repository: karma-runner/karma
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3653caf54502a524350359f193cef74eb21a6a85
Choose a head ref

Commits on Oct 5, 2020

  1. docs: clarify browser_complete vs run_complete

    Jonathan Ginsburg authored Oct 5, 2020
    Copy the full SHA
    e5086fc View commit details

Commits on Oct 6, 2020

  1. fix(context): do not error when karma is navigating (#3565)

    Change the flag name to karmaNavigating and set it along all paths where
    karma deliberately navigates. Other paths must be wrong.
    
    Fixes #3560
    johnjbarton authored Oct 6, 2020
    Copy the full SHA
    05dc288 View commit details

Commits on Dec 14, 2020

  1. Copy the full SHA
    f819fa8 View commit details
  2. Copy the full SHA
    3fed0bc View commit details

Commits on Dec 15, 2020

  1. fix(deps): bump socket-io to v3 (#3586)

    * fix socket-io deprecated default export
    BREAKING CHANGE:
    Some projects have socket.io tests that are version sensitive.
    Fixes #3569
    muuvmuuv authored Dec 15, 2020
    Copy the full SHA
    1b9e1de View commit details

Commits on Dec 17, 2020

  1. feat: remove support for running dart code in the browser (#3592)

    As Dartium browser is no more, there are no browsers left, which support running Dart applications natively and therefore we can remove such support from Karma to reduce the maintenance effort.
    
    BREAKING CHANGE: Using Karma to run Dart code in the browser is no longer supported. Use your favorite Dart-to-JS compiler instead.
    
    `dart` file type has been removed without a replacement.
    
    `customFileHandlers` DI token has been removed. Use [`middleware`](http://karma-runner.github.io/5.2/config/configuration-file.html#middleware) to achieve similar functionality.
    
    `customScriptTypes` DI token has been removed. It had no effect, so no replacement is provided.
    devoto13 authored Dec 17, 2020
    Copy the full SHA
    7a3bd55 View commit details
  2. feat(cli): error out on unexpected options or parameters (#3589)

    This should make CLI more helpful as it will error out early and users can see that they have passed a wrong option instead of guessing why it does not have any effect.
    
    Notes:
    
    - units tests use same parser configuration as production code (hence changes to tests)
    - logic and test case for _ typos in option names was removed as this is covered by yargs strict mode now
    - added documentation for couple of existing options as otherwise they are considered unknown and error out (but they do exist and were found in the unit tests)
    
    BREAKING CHANGE: Karma is more strict and will error out if unknown option or argument is passed to CLI.
    devoto13 authored Dec 17, 2020
    Copy the full SHA
    603bbc0 View commit details
  3. fix(client): do not reset karmaNavigating in unload handler (#3591)

    The unload handler itself does not know about navigation.
    May fix #3482
    johnjbarton authored Dec 17, 2020
    Copy the full SHA
    4a8178f View commit details

Commits on Dec 18, 2020

  1. feat(server): print stack of unhandledrejections (#3593)

    * feat(server): print stack of unhandledrejections
    
    The v8 engine includes the error with the stack and most of the time we
    need the stack also.
    
    Co-authored-by: Jonathan Ginsburg <jginsburgn@google.com>
    johnjbarton and Jonathan Ginsburg authored Dec 18, 2020
    Copy the full SHA
    35a5842 View commit details

Commits on Dec 21, 2020

  1. Copy the full SHA
    fb76ed6 View commit details
  2. feat(server): remove deprecated static methods (#3595)

    BREAKING CHANGE: Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form:
    
    ```
    const { Server } = require('karma');
    const server = new Server();
    server.start();
    ```
    devoto13 authored Dec 21, 2020
    Copy the full SHA
    1a65bf1 View commit details

Commits on Dec 23, 2020

  1. chore(build): unify client bundling scripts (#3600)

    Remove bundling logic from Grunt and introduce watch mode into the scripts/client.js. New script (`npm run build:watch`) allows to watch for the changes in client sources and bundle them automatically.
    
    This also fixes a bug where `npm run build` could swallow errors and silently do nothing.
    
    Fixes #3599
    devoto13 authored Dec 23, 2020
    Copy the full SHA
    fe0e24a View commit details
  2. fix(test): clear up clearContext (#3597)

    emit the 'complete' event after the navigation event, if any.
    The 'complete' event on the client triggers the server to begin shutdown.
    The shutdown can race with the navigate context.
    
    Simplify return_url implementation, assuming that we don't need any
    additional execution in the client after we send 'complete'.
    johnjbarton authored Dec 23, 2020
    Copy the full SHA
    8997b74 View commit details
  3. chore(build): remove obsolete Grunt tasks (#3602)

    These tasks are now handled by the semantic-release or other scripts and therefore we can clean them up.
    devoto13 authored Dec 23, 2020
    Copy the full SHA
    3c649fa View commit details
  4. Copy the full SHA
    e6b045f View commit details
  5. Copy the full SHA
    87f7e5e View commit details
  6. fix(test): mark all second connections reconnects (#3598)

    The reconnecting test is flakey, sometimes running the tests twice. This is exactly
    the behavior we are trying to prevent. Hard to reproduce.
    
    Refactoring:
     * rename newBrowser to knownBrowser as appropriate.
     * move browser STATE constant set/check into browser module.
         Browser should be the only place the state is set.
     * pass singleRun and clientConfig into Browser
     * pass isSocketReconnect into browser.reconnect()
     * rename browser.onDisconnect to browser.onSocketDisconnect to distinguish
       the socket from the reload cases.
    johnjbarton authored Dec 23, 2020
    Copy the full SHA
    1c9c2de View commit details

Commits on Jan 6, 2021

  1. fix(server): clean up close-server logic (#3607)

    The main change in behavior is the removal of `dieOnError` method. Previously Karma would send SIGINT to its own process and then trigger clean up logic upon receiving this signal. It is a pretty convoluted way to trigger shutdown. This commit extracts clean up logic into the `_close()` method and calls this method directly everywhere.
    
    This change solves two issues:
    - Makes life easier for other tools (like Angular CLI), which use Karma programmatically from another process and killing whole process on Karma error may not be the most convenient behavior. Instead Karma will clean up all its resources and notify caller using the `done` callback.
    - Allows to remove last Grunt bits in the future PR. When running unit tests without Grunt wrapper the SIGINT is received by the Mocha process, which stops tests execution midway.
    devoto13 authored Jan 6, 2021
    Copy the full SHA
    3fca456 View commit details

Commits on Jan 12, 2021

  1. Copy the full SHA
    fec972f View commit details
  2. Copy the full SHA
    68c4a3a View commit details

Commits on Jan 13, 2021

  1. feat(client): update banner with connection, test status, ping times (#…

    …3611)
    
    The banner is visible in videos so we can have some client side
    info on the state if it breaks.
    johnjbarton authored Jan 13, 2021
    Copy the full SHA
    4bf90f7 View commit details
  2. fix(ci): abandon browserstack tests for Safari and IE (#3615)

    Run test:client on Chrome for both travis and not travis.
    johnjbarton authored Jan 13, 2021
    Copy the full SHA
    04a811d View commit details
  3. chore(release): 6.0.0 [skip ci]

    # [6.0.0](v5.2.3...v6.0.0) (2021-01-13)
    
    ### Bug Fixes
    
    * **ci:** abandon browserstack tests for Safari and IE ([#3615](#3615)) ([04a811d](04a811d))
    * **client:** do not reset karmaNavigating in unload handler ([#3591](#3591)) ([4a8178f](4a8178f)), closes [#3482](#3482)
    * **context:** do not error when karma is navigating ([#3565](#3565)) ([05dc288](05dc288)), closes [#3560](#3560)
    * **cve:** update ua-parser-js to 0.7.23 to fix CVE-2020-7793 ([#3584](#3584)) ([f819fa8](f819fa8))
    * **cve:** update yargs to 16.1.1 to fix cve-2020-7774 in y18n ([#3578](#3578)) ([3fed0bc](3fed0bc)), closes [#3577](#3577)
    * **deps:** bump socket-io to v3 ([#3586](#3586)) ([1b9e1de](1b9e1de)), closes [#3569](#3569)
    * **middleware:** catch errors when loading a module ([#3605](#3605)) ([fec972f](fec972f)), closes [#3572](#3572)
    * **server:** clean up close-server logic ([#3607](#3607)) ([3fca456](3fca456))
    * **test:** clear up clearContext ([#3597](#3597)) ([8997b74](8997b74))
    * **test:** mark all second connections reconnects ([#3598](#3598)) ([1c9c2de](1c9c2de))
    
    ### Features
    
    * **cli:** error out on unexpected options or parameters ([#3589](#3589)) ([603bbc0](603bbc0))
    * **client:** update banner with connection, test status, ping times ([#3611](#3611)) ([4bf90f7](4bf90f7))
    * **server:** print stack of unhandledrejections ([#3593](#3593)) ([35a5842](35a5842))
    * **server:** remove deprecated static methods ([#3595](#3595)) ([1a65bf1](1a65bf1))
    * remove support for running dart code in the browser ([#3592](#3592)) ([7a3bd55](7a3bd55))
    
    ### BREAKING CHANGES
    
    * **server:** Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form:
    
    ```
    const { Server } = require('karma');
    const server = new Server();
    server.start();
    ```
    * **cli:** Karma is more strict and will error out if unknown option or argument is passed to CLI.
    * Using Karma to run Dart code in the browser is no longer supported. Use your favorite Dart-to-JS compiler instead.
    
    `dart` file type has been removed without a replacement.
    
    `customFileHandlers` DI token has been removed. Use [`middleware`](http://karma-runner.github.io/5.2/config/configuration-file.html#middleware) to achieve similar functionality.
    
    `customScriptTypes` DI token has been removed. It had no effect, so no replacement is provided.
    * **deps:** Some projects have socket.io tests that are version sensitive.
    semantic-release-bot committed Jan 13, 2021
    Copy the full SHA
    3653caf View commit details
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# [6.0.0](https://github.com/karma-runner/karma/compare/v5.2.3...v6.0.0) (2021-01-13)


### Bug Fixes

* **ci:** abandon browserstack tests for Safari and IE ([#3615](https://github.com/karma-runner/karma/issues/3615)) ([04a811d](https://github.com/karma-runner/karma/commit/04a811dc7a4b37aa56c0405880f03cb2493bf820))
* **client:** do not reset karmaNavigating in unload handler ([#3591](https://github.com/karma-runner/karma/issues/3591)) ([4a8178f](https://github.com/karma-runner/karma/commit/4a8178f3a0504ef007b23ef0fd8f5ca128f0c5c6)), closes [#3482](https://github.com/karma-runner/karma/issues/3482)
* **context:** do not error when karma is navigating ([#3565](https://github.com/karma-runner/karma/issues/3565)) ([05dc288](https://github.com/karma-runner/karma/commit/05dc28801627e3ce7054ae548046714dc2cf7a5e)), closes [#3560](https://github.com/karma-runner/karma/issues/3560)
* **cve:** update ua-parser-js to 0.7.23 to fix CVE-2020-7793 ([#3584](https://github.com/karma-runner/karma/issues/3584)) ([f819fa8](https://github.com/karma-runner/karma/commit/f819fa843fa0633edbe2af6ac2889e25ea2cb639))
* **cve:** update yargs to 16.1.1 to fix cve-2020-7774 in y18n ([#3578](https://github.com/karma-runner/karma/issues/3578)) ([3fed0bc](https://github.com/karma-runner/karma/commit/3fed0bc7dd042a09c8aec55c059654781a4584ec)), closes [#3577](https://github.com/karma-runner/karma/issues/3577)
* **deps:** bump socket-io to v3 ([#3586](https://github.com/karma-runner/karma/issues/3586)) ([1b9e1de](https://github.com/karma-runner/karma/commit/1b9e1de7d081e1c205debff27c6b5e1fe0585dee)), closes [#3569](https://github.com/karma-runner/karma/issues/3569)
* **middleware:** catch errors when loading a module ([#3605](https://github.com/karma-runner/karma/issues/3605)) ([fec972f](https://github.com/karma-runner/karma/commit/fec972ff63760f9606a4cef7673a68c55c880722)), closes [#3572](https://github.com/karma-runner/karma/issues/3572)
* **server:** clean up close-server logic ([#3607](https://github.com/karma-runner/karma/issues/3607)) ([3fca456](https://github.com/karma-runner/karma/commit/3fca456a02a65304d6423d6311fb55f83e73d85e))
* **test:** clear up clearContext ([#3597](https://github.com/karma-runner/karma/issues/3597)) ([8997b74](https://github.com/karma-runner/karma/commit/8997b7465de3c5f7e436078b57acae98de1ce39a))
* **test:** mark all second connections reconnects ([#3598](https://github.com/karma-runner/karma/issues/3598)) ([1c9c2de](https://github.com/karma-runner/karma/commit/1c9c2de54fa1abcb2c0edceebb159440b77e4863))


### Features

* **cli:** error out on unexpected options or parameters ([#3589](https://github.com/karma-runner/karma/issues/3589)) ([603bbc0](https://github.com/karma-runner/karma/commit/603bbc0db2ef4e6b8474f97a8255587f2a5f924e))
* **client:** update banner with connection, test status, ping times ([#3611](https://github.com/karma-runner/karma/issues/3611)) ([4bf90f7](https://github.com/karma-runner/karma/commit/4bf90f70f46cddf52a55d8f2b9ce0ccd2d4a4d3b))
* **server:** print stack of unhandledrejections ([#3593](https://github.com/karma-runner/karma/issues/3593)) ([35a5842](https://github.com/karma-runner/karma/commit/35a584234b00297dc511300bb6e42eeaceac8345))
* **server:** remove deprecated static methods ([#3595](https://github.com/karma-runner/karma/issues/3595)) ([1a65bf1](https://github.com/karma-runner/karma/commit/1a65bf1181bc9eb5c28ba0130ab7d90e89b21918))
* remove support for running dart code in the browser ([#3592](https://github.com/karma-runner/karma/issues/3592)) ([7a3bd55](https://github.com/karma-runner/karma/commit/7a3bd5545fa1307c754419252fa35ff0b7572ae4))


### BREAKING CHANGES

* **server:** Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form:

```
const { Server } = require('karma');
const server = new Server();
server.start();
```
* **cli:** Karma is more strict and will error out if unknown option or argument is passed to CLI.
* Using Karma to run Dart code in the browser is no longer supported. Use your favorite Dart-to-JS compiler instead.

`dart` file type has been removed without a replacement.

`customFileHandlers` DI token has been removed. Use [`middleware`](http://karma-runner.github.io/5.2/config/configuration-file.html#middleware) to achieve similar functionality.

`customScriptTypes` DI token has been removed. It had no effect, so no replacement is provided.
* **deps:** Some projects have socket.io tests that are version sensitive.

## [5.2.3](https://github.com/karma-runner/karma/compare/v5.2.2...v5.2.3) (2020-09-25)


2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (C) 2011-2019 Google, Inc.
Copyright (C) 2011-2020 Google, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@ install:
- npm run init:windows

test_script:
- npm run test:appveyor
- npm run test:unit
- npm run test:client

build: off

85 changes: 43 additions & 42 deletions client/karma.js
Original file line number Diff line number Diff line change
@@ -2,9 +2,10 @@ var stringify = require('../common/stringify')
var constant = require('./constants')
var util = require('../common/util')

function Karma (socket, iframe, opener, navigator, location, document) {
function Karma (updater, socket, iframe, opener, navigator, location, document) {
this.updater = updater
var startEmitted = false
var reloadingContext = false
var karmaNavigating = false
var self = this
var queryParams = util.parseQueryParams(location.search)
var browserId = queryParams.id || util.generateId('manual-')
@@ -41,9 +42,11 @@ function Karma (socket, iframe, opener, navigator, location, document) {
}
}

// This variable will be set to "true" whenever the socket lost connection and was able to
// reconnect to the Karma server. This will be passed to the Karma server then, so that
// Karma can differentiate between a socket client reconnect and a full browser reconnect.
// To start we will signal the server that we are not reconnecting. If the socket loses
// connection and was able to reconnect to the Karma server we will get a
// second 'connect' event. There we will pass 'true' and that will be passed to the
// Karma server then, so that Karma can differentiate between a socket client
// econnect and a full browser reconnect.
var socketReconnect = false

this.VERSION = constant.VERSION
@@ -80,6 +83,7 @@ function Karma (socket, iframe, opener, navigator, location, document) {

var childWindow = null
function navigateContextTo (url) {
karmaNavigating = true
if (self.config.useIframe === false) {
// run in new window
if (self.config.runInParent === false) {
@@ -89,9 +93,11 @@ function Karma (socket, iframe, opener, navigator, location, document) {
childWindow.close()
}
childWindow = opener(url)
karmaNavigating = false
// run context on parent element (client_with_context)
// using window.__karma__.scriptUrls to get the html element strings and load them dynamically
} else if (url !== 'about:blank') {
karmaNavigating = false
var loadScript = function (idx) {
if (idx < window.__karma__.scriptUrls.length) {
var parser = new DOMParser()
@@ -123,21 +129,15 @@ function Karma (socket, iframe, opener, navigator, location, document) {
// run in iframe
} else {
iframe.src = policy.createURL(url)
karmaNavigating = false
}
}

this.onbeforeunload = function () {
if (!reloadingContext) {
if (!karmaNavigating) {
// TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL)
self.error('Some of your tests did a full page reload!')
}
reloadingContext = false
}

function clearContext () {
reloadingContext = true

navigateContextTo('about:blank')
}

this.log = function (type, args) {
@@ -191,6 +191,7 @@ function Karma (socket, iframe, opener, navigator, location, document) {
}

socket.emit('karma_error', message)
self.updater.updateTestStatus(`karma_error ${message}`)
this.complete()
return false
}
@@ -213,17 +214,20 @@ function Karma (socket, iframe, opener, navigator, location, document) {

if (!startEmitted) {
socket.emit('start', { total: null })
self.updater.updateTestStatus('start')
startEmitted = true
}

if (resultsBufferLimit === 1) {
self.updater.updateTestStatus('result')
return socket.emit('result', convertedResult)
}

resultsBuffer.push(convertedResult)

if (resultsBuffer.length === resultsBufferLimit) {
socket.emit('result', resultsBuffer)
self.updater.updateTestStatus('result')
resultsBuffer = []
}
}
@@ -234,14 +238,16 @@ function Karma (socket, iframe, opener, navigator, location, document) {
resultsBuffer = []
}

if (self.config.clearContext) {
// A test could have incorrectly issued a navigate. To clear the context
// we will navigate the iframe. Delay ours to ensure the error from an
// incorrect navigate is processed.
setTimeout(clearContext)
}
// A test could have incorrectly issued a navigate. Wait one turn
// to ensure the error from an incorrect navigate is processed.
setTimeout(() => {
if (this.config.clearContext) {
navigateContextTo('about:blank')
}

socket.emit('complete', result || {})
self.updater.updateTestStatus('complete')

socket.emit('complete', result || {}, function () {
if (returnUrl) {
location.href = returnUrl
}
@@ -259,26 +265,24 @@ function Karma (socket, iframe, opener, navigator, location, document) {
}

socket.on('execute', function (cfg) {
// Delay our navigation to the next event in case the clearContext has not completed.
setTimeout(function allowClearContextToComplete () {
// reset startEmitted and reload the iframe
startEmitted = false
self.config = cfg

navigateContextTo(constant.CONTEXT_URL)

if (self.config.clientDisplayNone) {
[].forEach.call(document.querySelectorAll('#banner, #browsers'), function (el) {
el.style.display = 'none'
})
}
self.updater.updateTestStatus('execute')
// reset startEmitted and reload the iframe
startEmitted = false
self.config = cfg

// clear the console before run
// works only on FF (Safari, Chrome do not allow to clear console from js source)
if (window.console && window.console.clear) {
window.console.clear()
}
})
navigateContextTo(constant.CONTEXT_URL)

if (self.config.clientDisplayNone) {
[].forEach.call(document.querySelectorAll('#banner, #browsers'), function (el) {
el.style.display = 'none'
})
}

// clear the console before run
// works only on FF (Safari, Chrome do not allow to clear console from js source)
if (window.console && window.console.clear) {
window.console.clear()
}
})
socket.on('stop', function () {
this.complete()
@@ -305,9 +309,6 @@ function Karma (socket, iframe, opener, navigator, location, document) {
info.displayName = displayName
}
socket.emit('register', info)
})

socket.on('reconnect', function () {
socketReconnect = true
})
}
4 changes: 2 additions & 2 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -20,6 +20,6 @@ var socket = io(location.host, {
})

// instantiate the updater of the view
new StatusUpdater(socket, util.elm('title'), util.elm('banner'), util.elm('browsers'))
window.karma = new Karma(socket, util.elm('context'), window.open,
var updater = new StatusUpdater(socket, util.elm('title'), util.elm('banner'), util.elm('browsers'))
window.karma = new Karma(updater, socket, util.elm('context'), window.open,
window.navigator, window.location, window.document)
62 changes: 48 additions & 14 deletions client/updater.js
Original file line number Diff line number Diff line change
@@ -21,26 +21,60 @@ function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
}
}

function updateBanner (status) {
return function (param) {
if (!titleElement || !bannerElement) {
return
}
var paramStatus = param ? status.replace('$', param) : status
titleElement.textContent = 'Karma v' + VERSION + ' - ' + paramStatus
bannerElement.className = status === 'connected' ? 'online' : 'offline'
var connectionText = 'never-connected'
var testText = 'loading'
var pingText = ''

function updateBanner () {
if (!titleElement || !bannerElement) {
return
}
titleElement.textContent = `Karma v ${VERSION} - ${connectionText}; test: ${testText}; ${pingText}`
bannerElement.className = connectionText === 'connected' ? 'online' : 'offline'
}

function updateConnectionStatus (connectionStatus) {
connectionText = connectionStatus || connectionText
updateBanner()
}
function updateTestStatus (testStatus) {
testText = testStatus || testText
updateBanner()
}
function updatePingStatus (pingStatus) {
pingText = pingStatus || pingText
updateBanner()
}

socket.on('connect', () => {
updateConnectionStatus('connected')
})
socket.on('disconnect', () => {
updateConnectionStatus('disconnected')
})
socket.on('reconnecting', (sec) => {
updateConnectionStatus(`reconnecting in ${sec} seconds`)
})
socket.on('reconnect', () => {
updateConnectionStatus('reconnected')
})
socket.on('reconnect_failed', () => {
updateConnectionStatus('reconnect_failed')
})

socket.on('connect', updateBanner('connected'))
socket.on('disconnect', updateBanner('disconnected'))
socket.on('reconnecting', updateBanner('reconnecting in $ seconds...'))
socket.on('reconnect', updateBanner('connected'))
socket.on('reconnect_failed', updateBanner('failed to reconnect'))
socket.on('info', updateBrowsersInfo)
socket.on('disconnect', function () {
socket.on('disconnect', () => {
updateBrowsersInfo([])
})

socket.on('ping', () => {
updatePingStatus('ping...')
})
socket.on('pong', (latency) => {
updatePingStatus(`ping ${latency}ms`)
})

return { updateTestStatus: updateTestStatus }
}

module.exports = StatusUpdater
1 change: 0 additions & 1 deletion docs/config/02-files.md
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ Each pattern is either a simple string or an object with the following propertie
* `css` - Include using `<link rel="stylesheet">` tag.
* `html` - Include using [HTML Imports](https://developer.mozilla.org/en-US/docs/Web/Web_Components/HTML_Imports). Note that this feature is obsolete and does not work in the modern browsers.
* `js` - Include using `<script></script>` tag.
* `dart` - Include using `<script type="application/dart"></script>` tag. Note that this does not work in the modern browsers.
* `module` - Include using `<script type="module"></script>` tag.
* `dom` - Inline content of the file in the page. This can be used, for example, to test components combining HTML and JS.
* **Description.** The type determines the mechanism for including the file.
2 changes: 2 additions & 0 deletions docs/dev/02-making-changes.md
Original file line number Diff line number Diff line change
@@ -49,6 +49,8 @@ Here are some tips on how to set up a Karma workspace and how to send a good pul
- Build the client code via:
```bash
$ npm run build
# or use the watch mode
$ npm run build:watch
```

## Changing the Code
2 changes: 1 addition & 1 deletion docs/dev/04-public-api.md
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ A test run starts.
* `browsers`: A collection of browser instances
* `results`: A list of results

A test run was completed.
This event gets triggered whenever all the browsers, which belong to a test run, finish. For example, on a run that has 3 browsers, one would expect 3 `browser_complete` events before the `run_complete` one.

## karma.runner

3 changes: 1 addition & 2 deletions docs/dev/05-plugins.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ A preprocessor is a function that accepts three arguments (`content`, `file`, an
- user NPM keywords `karma-plugin`, `karma-preprocessor`

## Crazier stuff
Karma is assembled by Dependency Injection and a plugin is just an additional DI module (see [node-di] for more), that can be loaded by Karma. Therefore, it can ask for pretty much any Karma component and interact with it. There are a couple of plugins that do more interesting stuff like this, check out [karma-closure], [karma-intellij], [karma-dart].
Karma is assembled by Dependency Injection and a plugin is just an additional DI module (see [node-di] for more), that can be loaded by Karma. Therefore, it can ask for pretty much any Karma component and interact with it. There are a couple of plugins that do more interesting stuff like this, check out [karma-closure], [karma-intellij].


[karma-jasmine]: https://github.com/karma-runner/karma-jasmine
@@ -49,7 +49,6 @@ Karma is assembled by Dependency Injection and a plugin is just an additional DI
[karma-ng-html2js-preprocessor]: https://github.com/karma-runner/karma-ng-html2js-preprocessor
[karma-closure]: https://github.com/karma-runner/karma-closure
[karma-intellij]: https://github.com/karma-runner/karma-intellij
[karma-dart]: https://github.com/karma-runner/karma-dart
[node-di]: https://github.com/vojtajina/node-di
[karma-material-reporter]: https://github.com/ameerthehacker/karma-material-reporter

Loading