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: v3.0.0
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: v3.1.0
Choose a head ref

Commits on Aug 10, 2018

  1. Copy the full SHA
    33ed285 View commit details

Commits on Aug 13, 2018

  1. feat(config): Add config option for browser socket timeout (#3102)

    Add a configuration option that allows modification
    of the default timeout value for the client socket
    connection. The previous hardcoded value of 2000
    (ms) was insufficent for some environments.
    
    Closes #2927
    ndcornelius authored and johnjbarton committed Aug 13, 2018
    Copy the full SHA
    11e3a9d View commit details
  2. Copy the full SHA
    eeadcf2 View commit details

Commits on Aug 30, 2018

  1. Copy the full SHA
    74da748 View commit details

Commits on Sep 5, 2018

  1. Copy the full SHA
    8257375 View commit details
  2. Copy the full SHA
    301b2d6 View commit details
  3. Copy the full SHA
    c91cb81 View commit details

Commits on Sep 6, 2018

  1. Copy the full SHA
    68b37d3 View commit details
  2. fix(middleware): simplify stripHost. (#3115)

    The stripHost middleware only adds a modified url to the request.
    That modified url is only used one place. By converting the middleware
    to a module, the code is simpler and beforeMiddleware modules can reuse
    karma middleware. (One alternative considered was to move the stripHost
    in the chain before the beforeMiddleware, but this form seems better).
    
    Clean up regex per offline suggestion from zzo@
    johnjbarton authored Sep 6, 2018
    Copy the full SHA
    d65e911 View commit details

Commits on Sep 23, 2018

  1. Copy the full SHA
    6742ecf View commit details

Commits on Oct 1, 2018

  1. Copy the full SHA
    20eab32 View commit details

Commits on Oct 2, 2018

  1. docs: Updated supported Node versions in the documentation (#3155)

    * docs: update information on supported node versions
    
    * docs: update links to point to latest version on the website
    devoto13 authored and johnjbarton committed Oct 2, 2018
    Copy the full SHA
    f71da20 View commit details

Commits on Oct 3, 2018

  1. 2
    Copy the full SHA
    c67b90a View commit details
  2. refactor(launcher): use this directly instead assign to self variable…

    … in base launcher (#3157)
    lusarz authored and johnjbarton committed Oct 3, 2018
    Copy the full SHA
    f68087c View commit details
  3. refactor(launcher): use this directly instead assign to self variable…

    … in capture_timeout launcher (#3158)
    lusarz authored and johnjbarton committed Oct 3, 2018
    Copy the full SHA
    cb19de6 View commit details
  4. refactor(launcher): use this directly instead assign to self variable…

    … in retry launcher (#3159)
    lusarz authored and johnjbarton committed Oct 3, 2018
    Copy the full SHA
    18a750d View commit details
  5. Copy the full SHA
    637b553 View commit details

Commits on Oct 5, 2018

  1. fix(test/client): revert const/let changes.

    We still test in IE9/10 where the var is king.
    johnjbarton authored and lusarz committed Oct 5, 2018
    Copy the full SHA
    c097ecf View commit details
  2. fix: work around broken console methods

    Sometimes console methods are broken, but this shouldn't break tests.
    See angular/angular.js#16644 (comment)
    thorn0 authored and lusarz committed Oct 5, 2018
    Copy the full SHA
    873e4f9 View commit details
  3. feat(server): Add stop method (#3153)

    Fix #3149
    filipesilva authored and johnjbarton committed Oct 5, 2018
    Copy the full SHA
    6d96d8e View commit details
  4. refactor(server): use Array.prototype.includes/startsWitch methods in…

    …stead of indexOf (#3161)
    lusarz authored and johnjbarton committed Oct 5, 2018
    Copy the full SHA
    65ae574 View commit details

Commits on Oct 6, 2018

  1. Copy the full SHA
    6db1df1 View commit details
  2. Copy the full SHA
    4ba83e2 View commit details
  3. Copy the full SHA
    5e5fdae View commit details

Commits on Oct 10, 2018

  1. Copy the full SHA
    7af46b9 View commit details

Commits on Oct 11, 2018

  1. Copy the full SHA
    29523ff View commit details
  2. Copy the full SHA
    9bd7e1d View commit details
  3. Copy the full SHA
    c921010 View commit details
  4. Copy the full SHA
    871a1c9 View commit details
  5. feat(server): Add public API to force a file refresh

    Adds a public API similar to `server.refreshFiles()` that allows to refresh a specific file.
    This is useful for preprocessors that process files with dependencies (sass, js modules, postcss), so they can trigger an update on a file when a change is detected on a dependency.
    Contrary to `server.refreshFiles()` it allows to refresh only the file that need to be processed again.
    pvdlg authored and lusarz committed Oct 11, 2018
    Copy the full SHA
    dab8a82 View commit details
  6. refactor(server): refactoring of lib/browser (#3171)

    * refactor(config): small refactoring of lib/config
    
    * refactor(server): refactoring of lib/browser
    lusarz authored and johnjbarton committed Oct 11, 2018
    Copy the full SHA
    8efb28d View commit details

Commits on Oct 12, 2018

  1. Copy the full SHA
    5cc4089 View commit details
  2. feat(server): .dom files include HTML tags in page. (#3178)

    Add support for .dom extension files, insert the content of the file into the test HTML
    document. This allows 'component' tests where JS interacts with HTML. Provides a simpler
    alternative to solutions that use JS to embed HTML in JS then write it into the DOM.
    Limited to cases where the DOM fragments from different tests do not interfere.
    johnjbarton authored Oct 12, 2018
    Copy the full SHA
    4651524 View commit details

Commits on Oct 13, 2018

  1. Copy the full SHA
    f28a454 View commit details

Commits on Oct 14, 2018

  1. fix(config): remove phantomjs in favor of chrome headless (#3175)

    * use custom launcher with --no-sandbox, see https://docs.travis-ci.com/user/chrome
    lusarz authored and johnjbarton committed Oct 14, 2018
    Copy the full SHA
    0f8b2b1 View commit details

Commits on Oct 15, 2018

  1. feat(config): add support for ES modules

    - Add support for ES modules via `esModule` property in file config object
    
    * test(modules): ensure relative paths work correctly
    
    * test(e2e): module-types
    
    `esModule: true` is now `type: 'module'`.  Test updated to reflect that.
    sergei-startsev authored and johnjbarton committed Oct 15, 2018
    Copy the full SHA
    e811adb View commit details
  2. Copy the full SHA
    7634e71 View commit details

Commits on Oct 16, 2018

  1. Copy the full SHA
    c311ac0 View commit details
  2. Copy the full SHA
    1458267 View commit details

Commits on Oct 17, 2018

  1. Copy the full SHA
    8542f27 View commit details
  2. Copy the full SHA
    f94284d View commit details

Commits on Oct 22, 2018

  1. Copy the full SHA
    2385690 View commit details
  2. chore: release v3.1.0

    johnjbarton committed Oct 22, 2018
    Copy the full SHA
    0a2d2e9 View commit details
Showing with 3,391 additions and 2,869 deletions.
  1. +32 −0 CHANGELOG.md
  2. +1 −1 CONTRIBUTING.md
  3. +1 −1 LICENSE
  4. +3 −0 PULL_REQUEST_TEMPLATE.md
  5. +1 −0 client/constants.js
  6. +2 −1 client/main.js
  7. +10 −2 context/karma.js
  8. +37 −0 docs/config/01-configuration-file.md
  9. +11 −7 docs/config/02-files.md
  10. +8 −0 docs/dev/04-public-api.md
  11. +11 −0 docs/dev/05-plugins.md
  12. +1 −1 docs/intro/01-installation.md
  13. +1 −1 docs/intro/04-faq.md
  14. +93 −132 lib/browser.js
  15. +36 −33 lib/browser_collection.js
  16. +3 −2 lib/browser_result.js
  17. +12 −7 lib/cli.js
  18. +26 −66 lib/completion.js
  19. +53 −86 lib/config.js
  20. +1 −6 lib/emitter_wrapper.js
  21. +9 −15 lib/executor.js
  22. +15 −15 lib/file-list.js
  23. +4 −0 lib/file.js
  24. +14 −2 lib/helper.js
  25. +15 −22 lib/init.js
  26. +2 −2 lib/init/color_schemes.js
  27. +7 −7 lib/init/state_machine.js
  28. +5 −9 lib/launcher.js
  29. +22 −23 lib/launchers/base.js
  30. +9 −10 lib/launchers/capture_timeout.js
  31. +23 −25 lib/launchers/process.js
  32. +10 −13 lib/launchers/retry.js
  33. +7 −7 lib/logger.js
  34. +33 −52 lib/middleware/common.js
  35. +101 −115 lib/middleware/karma.js
  36. +42 −74 lib/middleware/proxy.js
  37. +14 −13 lib/middleware/runner.js
  38. +12 −3 lib/middleware/source_files.js
  39. +1 −1 lib/middleware/stopper.js
  40. +4 −11 lib/middleware/strip_host.js
  41. +4 −4 lib/plugin.js
  42. +4 −5 lib/preprocessor.js
  43. +7 −7 lib/reporter.js
  44. +3 −4 lib/reporters/base.js
  45. +2 −2 lib/reporters/dots.js
  46. +2 −2 lib/reporters/dots_color.js
  47. +2 −2 lib/reporters/progress.js
  48. +2 −2 lib/reporters/progress_color.js
  49. +34 −19 lib/server.js
  50. +13 −17 lib/stopper.js
  51. +1 −1 lib/utils/net-utils.js
  52. +7 −11 lib/watcher.js
  53. +22 −5 lib/web-server.js
  54. +78 −69 package.json
  55. +6 −1 static/context.html
  56. +6 −1 static/debug.html
  57. +2 −2 tasks/init-dev-env.js
  58. +4 −4 tasks/test.js
  59. +51 −31 test/client/karma.spec.js
  60. +4 −4 test/e2e/basic.feature
  61. +17 −17 test/e2e/browser_console.feature
  62. +3 −3 test/e2e/custom-context.feature
  63. +6 −6 test/e2e/displayname.feature
  64. +3 −3 test/e2e/error.feature
  65. +21 −21 test/e2e/files.feature
  66. +3 −3 test/e2e/headers.feature
  67. +8 −8 test/e2e/load.feature
  68. +6 −6 test/e2e/middleware.feature
  69. +7 −7 test/e2e/mocharepoter.feature
  70. +35 −0 test/e2e/module-types.feature
  71. +2 −2 test/e2e/pass-opts.feature
  72. +9 −9 test/e2e/proxy.feature
  73. +3 −3 test/e2e/reconnecting.feature
  74. +4 −4 test/e2e/runInParent.feature
  75. +42 −42 test/e2e/step_definitions/core_steps.js
  76. +2 −2 test/e2e/step_definitions/hooks.js
  77. +6 −6 test/e2e/stop.feature
  78. +1 −1 test/e2e/support/env.js
  79. +1 −1 test/e2e/support/headers/test.js
  80. +1 −1 test/e2e/support/middleware/test.js
  81. +11 −0 test/e2e/support/modules/__tests__/minus.test.mjs
  82. +11 −0 test/e2e/support/modules/__tests__/plus.test.js
  83. +4 −0 test/e2e/support/modules/minus.mjs
  84. +4 −0 test/e2e/support/modules/plus.js
  85. +5 −5 test/e2e/support/proxy.js
  86. +1 −1 test/e2e/support/proxy/test.js
  87. +2 −2 test/e2e/support/tag/tag.js
  88. +14 −11 test/e2e/support/world.js
  89. +3 −3 test/e2e/upstream-proxy.feature
  90. +94 −4 test/unit/browser_collection.spec.js
  91. +2 −2 test/unit/browser_result.spec.js
  92. +1 −1 test/unit/cli.spec.js
  93. +1 −1 test/unit/config.spec.js
  94. +17 −17 test/unit/events.spec.js
  95. +32 −15 test/unit/file-list.spec.js
  96. +28 −0 test/unit/helper.spec.js
  97. +38 −38 test/unit/init.spec.js
  98. +8 −8 test/unit/init/formatters.spec.js
  99. +17 −17 test/unit/init/state_machine.spec.js
  100. +27 −29 test/unit/launcher.spec.js
  101. +33 −33 test/unit/launchers/base.spec.js
  102. +6 −6 test/unit/launchers/capture_timeout.spec.js
  103. +40 −39 test/unit/launchers/process.spec.js
  104. +11 −11 test/unit/launchers/retry.spec.js
  105. +5 −5 test/unit/logger.spec.js
  106. +76 −29 test/unit/middleware/karma.spec.js
  107. +46 −47 test/unit/middleware/proxy.spec.js
  108. +265 −255 test/unit/middleware/runner.spec.js
  109. +53 −17 test/unit/middleware/source_files.spec.js
  110. +16 −49 test/unit/middleware/strip_host.spec.js
  111. +10 −10 test/unit/mocha-globals.js
  112. +2 −2 test/unit/mocks/timer.js
  113. +1 −1 test/unit/preprocessor.spec.js
  114. +42 −42 test/unit/reporter.spec.js
  115. +3 −3 test/unit/reporters/progress.spec.js
  116. +14 −14 test/unit/runner.spec.js
  117. +41 −22 test/unit/server.spec.js
  118. +1 −1 test/unit/utils/bundle-utils.spec.js
  119. +14 −14 test/unit/watcher.spec.js
  120. +27 −25 test/unit/web-server.spec.js
  121. +1,239 −987 yarn.lock
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
<a name="3.1.0"></a>
# [3.1.0](https://github.com/karma-runner/karma/compare/v3.0.0...v3.1.0) (2018-10-22)


### Bug Fixes

* work around broken console methods ([873e4f9](https://github.com/karma-runner/karma/commit/873e4f9)), closes [/github.com/angular/angular.js/pull/16644#issuecomment-407680658](https://github.com//github.com/angular/angular.js/pull/16644/issues/issuecomment-407680658)
* **browser:** emit 'browsers_change' in collection ([#3183](https://github.com/karma-runner/karma/issues/3183)) ([7634e71](https://github.com/karma-runner/karma/commit/7634e71))
* **config:** remove phantomjs in favor of chrome headless ([#3175](https://github.com/karma-runner/karma/issues/3175)) ([0f8b2b1](https://github.com/karma-runner/karma/commit/0f8b2b1))
* **init:** Support ChromeHeadless in `validateBrowser` ([#3110](https://github.com/karma-runner/karma/issues/3110)) ([eeadcf2](https://github.com/karma-runner/karma/commit/eeadcf2))
* **middleware:** simplify stripHost. ([#3115](https://github.com/karma-runner/karma/issues/3115)) ([d65e911](https://github.com/karma-runner/karma/commit/d65e911))
* **runner:** Do not persist grep option across runs ([#3121](https://github.com/karma-runner/karma/issues/3121)) ([c91cb81](https://github.com/karma-runner/karma/commit/c91cb81))
* **runner:** Make exit code configurable when tests are failing ([#3116](https://github.com/karma-runner/karma/issues/3116)) ([74da748](https://github.com/karma-runner/karma/commit/74da748)), closes [#1300](https://github.com/karma-runner/karma/issues/1300)
* **test/client:** revert const/let changes. ([c097ecf](https://github.com/karma-runner/karma/commit/c097ecf))


### Features

* **config:** Add config option for browser socket timeout ([#3102](https://github.com/karma-runner/karma/issues/3102)) ([11e3a9d](https://github.com/karma-runner/karma/commit/11e3a9d)), closes [#2927](https://github.com/karma-runner/karma/issues/2927)
* **config:** add support for ES modules ([e811adb](https://github.com/karma-runner/karma/commit/e811adb))
* **frameworks:** report start() errors back to server. ([#3126](https://github.com/karma-runner/karma/issues/3126)) ([8257375](https://github.com/karma-runner/karma/commit/8257375))
* **server:** .dom files include HTML tags in page. ([#3178](https://github.com/karma-runner/karma/issues/3178)) ([4651524](https://github.com/karma-runner/karma/commit/4651524))
* **server:** Add public API to force a file refresh ([dab8a82](https://github.com/karma-runner/karma/commit/dab8a82))
* **server:** Add stop method ([#3153](https://github.com/karma-runner/karma/issues/3153)) ([6d96d8e](https://github.com/karma-runner/karma/commit/6d96d8e)), closes [#3149](https://github.com/karma-runner/karma/issues/3149)
* **server:** Add support for encoded source files ([#3123](https://github.com/karma-runner/karma/issues/3123)) ([68b37d3](https://github.com/karma-runner/karma/commit/68b37d3))



<a name="3.0.0"></a>
# [3.0.0](https://github.com/karma-runner/karma/compare/v2.0.5...v3.0.0) (2018-08-09)

@@ -13,6 +41,10 @@
* **travis:** validate TRAVIS_COMMIT if TRAVIS_PULL_REQUEST_SHA is not set. ([#3094](https://github.com/karma-runner/karma/issues/3094)) ([fba5d36](https://github.com/karma-runner/karma/commit/fba5d36))
* **travis:** Validate TRAVIS_PULL_REQUEST_SHA rather than TRAVIS_COMMIT. ([#3093](https://github.com/karma-runner/karma/issues/3093)) ([a58fa45](https://github.com/karma-runner/karma/commit/a58fa45))

### BREAKING CHANGES

* Drop Support for Nodejs4 ([#3082](https://github.com/karma-runner/karma/pull/3082))



<a name="2.0.6"></a>
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ with a fix.
**Working on your first Pull Request?** You can learn how from this *free* series
[How to Contribute to an Open Source Project on GitHub][egghead_series]

[docs_contributing]: http://karma-runner.github.io/0.13/dev/contributing.html
[docs_contributing]: http://karma-runner.github.io/latest/dev/contributing.html
[gitter]: https://gitter.im/karma-runner/karma
[stackoverflow]: http://stackoverflow.com/questions/tagged/karma-runner
[github_newissue]: https://github.com/karma-runner/karma/issues/new
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-2016 Google, Inc.
Copyright (C) 2011-2018 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: 3 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Check that your description matches the automatic change-log format:
http://karma-runner.github.io/latest/dev/git-commit-msg.html
then delete this reminder.
1 change: 1 addition & 0 deletions client/constants.js
Original file line number Diff line number Diff line change
@@ -2,5 +2,6 @@ module.exports = {
VERSION: '%KARMA_VERSION%',
KARMA_URL_ROOT: '%KARMA_URL_ROOT%',
KARMA_PROXY_PATH: '%KARMA_PROXY_PATH%',
BROWSER_SOCKET_TIMEOUT: '%BROWSER_SOCKET_TIMEOUT%',
CONTEXT_URL: 'context.html'
}
3 changes: 2 additions & 1 deletion client/main.js
Original file line number Diff line number Diff line change
@@ -9,12 +9,13 @@ var constants = require('./constants')

var KARMA_URL_ROOT = constants.KARMA_URL_ROOT
var KARMA_PROXY_PATH = constants.KARMA_PROXY_PATH
var BROWSER_SOCKET_TIMEOUT = constants.BROWSER_SOCKET_TIMEOUT

// Connect to the server using socket.io http://socket.io
var socket = io(location.host, {
reconnectionDelay: 500,
reconnectionDelayMax: Infinity,
timeout: 20000,
timeout: BROWSER_SOCKET_TIMEOUT,
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
'sync disconnect on unload': true
})
12 changes: 10 additions & 2 deletions context/karma.js
Original file line number Diff line number Diff line change
@@ -37,7 +37,11 @@ function ContextKarma (callParentKarmaMethod) {
this.loaded = function () {
// has error -> cancel
if (!hasError) {
this.start(this.config)
try {
this.start(this.config)
} catch (error) {
this.error(error.stack || error.toString())
}
}

// remove reference to child iframe
@@ -118,7 +122,11 @@ function ContextKarma (callParentKarmaMethod) {
}
localConsole[method] = function () {
self.log(method, arguments)
return Function.prototype.apply.call(orig, localConsole, arguments)
try {
return Function.prototype.apply.call(orig, localConsole, arguments)
} catch (error) {
self.log('warn', ['Console method ' + method + ' threw: ' + error])
}
}
}
for (var i = 0; i < logMethods.length; i++) {
37 changes: 37 additions & 0 deletions docs/config/01-configuration-file.md
Original file line number Diff line number Diff line change
@@ -53,6 +53,20 @@ module.exports = (config) => {
}
```

### Customized TypeScript Configuration
Under the hood Karma uses ts-node to transpile TypeScript to JavaScript. If the resolved `tsconfig.json` has `module` configured as `ES` formats. You might get errors like `SyntaxError: Unexpected token`. This is due that in Node `ES` module formats are not supported. To overcome this issue you need to configure ts-node to use `commonjs` module format.

Create a JavaScript configuration file that overrides the module format.
```javascript
// karma.conf.js
require('ts-node').register({
compilerOptions: {
module: 'commonjs'
}
});
require('./karma.conf.ts');
```

## File Patterns
All of the configuration options, which specify file paths, use the [minimatch][minimatch] library to facilitate flexible
but concise file expressions so you can easily list all of the files you want to include and exclude.
@@ -793,6 +807,29 @@ If set then the following fields will be defined and can be overriden:
All of Karma's urls get prefixed with the `urlRoot`. This is helpful when using proxies, as
sometimes you might want to proxy a url that is already taken by Karma.

## browserSocketTimeout
**Type:** Number

**Default:** `20000`

**Description:** Timeout for the client socket connection (in ms).

This configuration represents the amount of time that the client will wait for the socket
to connect.

When running a browser in different environments, it can take different amounts of time for the
client socket to connect. If Karma cannot connect within the default timeout, you may see an
error similar to the following:
```
ChromeHeadless have not captured in 60000ms, killing.
Trying to start ChromeHeadless again (1/2).
ChromeHeadless have not captured in 60000ms, killing.
Trying to start ChromeHeadless again (2/2).
ChromeHeadless have not captured in 60000ms, killing.
ChromeHeadless failed 2 times(timeout). Giving up.
```
If you see this error, you can try increasing the socket connection timeout.


[plugins]: plugins.html
[config/files]: files.html
18 changes: 11 additions & 7 deletions docs/config/02-files.md
Original file line number Diff line number Diff line change
@@ -34,6 +34,10 @@ Each pattern is either a simple string or an object with the following propertie
* `js`
* `dart`
* `module`
* `dom`
* **Description.** The type determines the mechanism for including the file. The `css` and `html` types
create `link` elements; the `js`, `dart`, and `module` elements create `script` elements. The `dom` type
includes the file content in the page, used, for example, to test components combinging HTML and JS.

### `watched`
* **Type.** Boolean
@@ -46,17 +50,17 @@ Each pattern is either a simple string or an object with the following propertie
* **Description.** Should the files be included in the browser using
`<script>` tag? Use `false` if you want to load them manually, eg.
using [Require.js](../plus/requirejs.html).

If a file is covered by multiple patterns with different `include` properties, the most specific pattern takes
precedence over the other.
The specificity of the pattern is defined as a six-tuple, where larger tuple implies lesser specificity:

The specificity of the pattern is defined as a six-tuple, where larger tuple implies lesser specificity:
*(n<sub>glob parts</sub>, n<sub>glob star</sub>, n<sub>star</sub>, n<sub>ext glob</sub>, n<sub>range</sub>, n<sub>optional</sub>)*.
Tuples are compared lexicographically.
The *n<sub>glob parts</sub>* is the number of patterns after the bracket sections are expanded. E.g. the
Tuples are compared lexicographically.

The *n<sub>glob parts</sub>* is the number of patterns after the bracket sections are expanded. E.g. the
the pattern *{0...9}* will yield *n<sub>glob parts</sub>=10*. The rest of the tuple is decided as the least
specific of each expanded pattern.
specific of each expanded pattern.

### `served`
* **Type.** Boolean
8 changes: 8 additions & 0 deletions docs/dev/04-public-api.md
Original file line number Diff line number Diff line change
@@ -33,6 +33,14 @@ Trigger a file list refresh. Returns a promise.
server.refreshFiles()
```

### **server.refreshFile(path)**

Trigger a file refresh. Returns a promise.

```javascript
server.refreshFile('src/js/module-dep.js')
```

### Events

The `server` object is an [`EventEmitter`](https://nodejs.org/docs/latest/api/events.html#events_class_events_eventemitter). You can simply listen to events like this:
11 changes: 11 additions & 0 deletions docs/dev/05-plugins.md
Original file line number Diff line number Diff line change
@@ -18,6 +18,17 @@ Karma can be extended through plugins. A plugin is essentially an NPM module. Ty
- use NPM keywords `karma-plugin`, `karma-launcher`

## Preprocessors

A preprocessor is a function that accepts three arguments (`content`, `file`, and `next`), mutates the content in some way, and passes it on to the next preprocessor.

- arguments passed to preprocessor plugins:
- **`content`** of the file being processed
- **`file`** object describing the file being processed
- **path:** the current file, mutable file path. e. g. `some/file.coffee` -> `some/file.coffee.js` _This path is mutable and may not actually exist._
- **originalPath:** the original, unmutated path
- **encodings:** A mutable, keyed object where the keys are a valid encoding type ('gzip', 'compress', 'br', etc.) and the values are the encoded content. Encoded content should be stored here and not resolved using `next(null, encodedContent)`
- **type:** the pattern used to match the file
- **`next`** function to be called when preprocessing is complete, should be called as `next(null, processedContent)` or `next(error)`
- example plugins: [karma-coffee-preprocessor], [karma-ng-html2js-preprocessor]
- use naming convention is `karma-*-preprocessor`
- user NPM keywords `karma-plugin`, `karma-preprocessor`
2 changes: 1 addition & 1 deletion docs/intro/01-installation.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ Karma runs on [Node.js] and is available as an [NPM] package.
On Mac or Linux we recommend using [NVM](https://github.com/creationix/nvm). On Windows, download Node.js
from [the official site](https://nodejs.org/) or use the [NVM PowerShell Module](https://www.powershellgallery.com/packages/nvm).

Note: Karma currently works on Node.js **4.x**, **5.x**, **6.x**, **7.x**, and **8.x**. See [FAQ] for more info.
Note: Karma currently works on Node.js **6.x**, **8.x**, and **10.x**. See [FAQ] for more info.

## Installing Karma and plugins

2 changes: 1 addition & 1 deletion docs/intro/04-faq.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ The latest stable version from NPM (`npm install karma`). See [versioning] for m


### Which version of Node.js does Karma run with?
Karma works on all LTS versions node in active maintenance state (see [LTS docs](https://github.com/nodejs/LTS/blob/master/README.md) for more info) as well as the latest stable version. That is **4.x**, **5.x**, **6.x**, and **8.x** at this point.
Karma works on all LTS versions node in active maintenance state (see [LTS docs](https://github.com/nodejs/Release/blob/master/README.md) for more info) as well as the latest stable version. That is **6.x**, **8.x** and **10.x** at this point.


[mailing list]: https://groups.google.com/d/forum/karma-users
Loading