Skip to content

Commit 94cf15e

Browse files
authored
docs: updates to the documentation to support new markdown renderer (#3672)
Companion PR for karma-runner/karma-runner.github.com#62. * docs: fix invalid heading syntax It is not recognized as a heading by the markdown parser without a whitespace. * docs: fix weird syntax to reduce diff Old parser considered this the same list, but new parser assumes that these are two separate lists. Technically it should be a nested list, but it is old and shouldn't really matter. I'm doing this change to reduce the diff I need to review after switching to the new markdown parser. * docs: fix invalid markdown Items nested in the list item, must be indented 3 spaces, not 2 spaces. New parser produced a pretty messed up markup from the invalid markdown. * docs: remove redundant whitespaces in the list items
1 parent cc9420d commit 94cf15e

18 files changed

+122
-95
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ module.exports = function(karma) {
21212121

21222122
#### Breaking Changes
21232123

2124-
* rename the project to "Karma":
2124+
- rename the project to "Karma":
21252125
- whenever you call the "testacular" binary, change it to "karma", eg. `testacular start` becomes `karma start`.
21262126
- if you rely on default name of the config file, change it to `karma.conf.js`.
21272127
- if you access `__testacular__` object in the client code, change it to `__karma__`, eg. `window.__testacular__.files` becomes `window.__karma__.files`. ([026a20f7](https://github.com/karma-runner/karma/commit/026a20f7b467eb3b39c68ed509acc06e5dad58e6))

docs/about/03-migration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
---
12
pageTitle: Migration from v0.10
2-
3+
---
34

45
The good thing is that you don't have to migrate everything at once.
56
You can leave all the existing projects using an older version of Karma and only use the latest

docs/dev/01-contributing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
pageTitle: Contributing to Karma
3+
---
24

35
**Working on your first Pull Request?** You can learn how from this *free* series
46
[How to Contribute to an Open Source Project on GitHub]

docs/dev/03-maintaining.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
---
12
pageTitle: Maintaining Karma
2-
3-
3+
---
44

55
This document is for people working on Karma. It describes common tasks such as triaging or merging
66
pull requests.

docs/dev/04-public-api.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can, however, call Karma programmatically from your node module. Here is the
66

77
### `constructor`
88

9-
- **Returns:** `Server` instance.
9+
- **Returns:** `Server` instance.
1010

1111
#### Usage
1212

@@ -150,7 +150,7 @@ This event gets triggered whenever all the browsers, which belong to a test run,
150150

151151
### `runner.run(options, [callback=process.exit])`
152152

153-
- **Returns:** `EventEmitter`
153+
- **Returns:** `EventEmitter`
154154

155155
The equivalent of `karma run`.
156156

@@ -310,25 +310,25 @@ cfg.parseConfig(
310310

311311
#### `configFilePath` argument
312312

313-
- **Type:** String | `null` | `undefined`
314-
- **Default Value:** `undefined`
313+
- **Type:** String | `null` | `undefined`
314+
- **Default Value:** `undefined`
315315

316316
A string representing a file system path pointing to the config file whose
317317
default export is a function that will be used to set Karma configuration
318318
options. This function will be passed an instance of the `Config` class as its
319319
first argument. If this option is not provided, then only the options provided
320320
by the `cliOptions` argument will be set.
321321

322-
- JavaScript must use CommonJS modules.
323-
- ECMAScript modules are not currently supported by Karma when using
322+
- JavaScript must use CommonJS modules.
323+
- ECMAScript modules are not currently supported by Karma when using
324324
JavaScript.
325-
- Other formats, such as TypeScript, may support ECMAScript modules.
325+
- Other formats, such as TypeScript, may support ECMAScript modules.
326326

327327

328328
#### `cliOptions` argument
329329

330-
- **Type:** Object | `null` | `undefined`
331-
- **Default Value:** `undefined`
330+
- **Type:** Object | `null` | `undefined`
331+
- **Default Value:** `undefined`
332332

333333
An object whose values will take priority over options set in the config file.
334334
The config object passed to function exported by the config file will already
@@ -344,8 +344,8 @@ programatic users may construct this object or leave it out entirely.
344344

345345
#### `parseOptions` argument
346346

347-
- **Type:** Object | `null` | `undefined`
348-
- **Default Value:** `undefined`
347+
- **Type:** Object | `null` | `undefined`
348+
- **Default Value:** `undefined`
349349

350350
`parseOptions` is an object whose properties are configuration options that
351351
allow additional control over parsing and opt-in access to new behaviors or
@@ -357,8 +357,8 @@ not related to the configuration of Karma itself.
357357

358358
##### `parseOptions.promiseConfig` option
359359

360-
- **Type:** Boolean
361-
- **Default Value:** `false`
360+
- **Type:** Boolean
361+
- **Default Value:** `false`
362362

363363
When `parseOptions.promiseConfig === true`, then `parseConfig` will return a
364364
promise instead of a configuration object.
@@ -382,8 +382,8 @@ disables process exiting and allows errors to result in rejected promises.**_
382382

383383
##### `parseOptions.throwErrors` option
384384

385-
- **Type:** Boolean
386-
- **Default Value:** `false`
385+
- **Type:** Boolean
386+
- **Default Value:** `false`
387387

388388
In the past, `parseConfig()` would call `process.exit(exitCode)` when it
389389
encountered a critical failure. This meant that your own code had no way of

docs/dev/05-plugins.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
pageTitle: Developing Plugins
3+
---
24

35
Karma can be extended through plugins. There are five kinds of plugins: *framework*, *reporter*, *launcher*, *preprocessor* and *middleware*. Each type allows to modify a certain aspect of the Karma behavior.
46

docs/dev/06-git-commit-msg.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
showInMenu: false
3+
---
24

35
## The reasons for these conventions:
46
- automatic generating of the changelog

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
---
12
layout: homepage
23
pageTitle: Spectacular Test Runner for Javascript
4+
---

docs/intro/04-faq.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: Frequently Asked Questions
23
menuTitle: FAQ
4+
---
35

46
The list below is a collection of common questions regarding Karma and its use.
57
If you have any other questions in mind, please visit the [mailing list] to let the community know.

docs/intro/05-troubleshooting.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: Troubleshooting
23
menuTitle: Troubleshooting
4+
---
35

46
karma has an extensive set of tests and we have limited time to help with bugs. Here are some suggestions to get you unstuck.
57

docs/plus/01-requirejs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: RequireJS
23
menuTitle: RequireJS
4+
---
35

46
To get Karma to run with [Require.js] we need two files:
57

docs/plus/02-travis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: Travis CI
23
menuTitle: Travis CI
4+
---
35

46
[Travis CI] is a popular continuous integration service that
57
integrates with your [Github] repository to automatically run your

docs/plus/03-jenkins.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: Jenkins CI
23
menuTitle: Jenkins CI
4+
---
35

46
[Jenkins CI] is one of the most popular continuous integration servers
57
in the market today. At some point while developing your [AngularJS]

docs/plus/04-semaphore.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: Semaphore CI
23
menuTitle: Semaphore CI
4+
---
35

46
[Semaphore] is a popular continuous integration service that
57
supports a [wide range of programming languages]. Up-to-date

docs/plus/06-angularjs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
---
12
pageTitle: AngularJS
23
menuTitle: AngularJS
4+
---
35

46
If you're using [AngularJS](https://angularjs.org), check out the [AngularJS Generator](https://github.com/yeoman/generator-angular), which makes use of the [Karma Generator](https://github.com/yeoman/generator-karma) to setup a fully featured, testing-ready project.

docs/plus/08-emberjs.md

Lines changed: 77 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,99 @@
1+
---
12
pageTitle: Ember.js
23
menuTitle: Ember.js
4+
---
35

46
To execute javascript unit and integration tests with ember.js follow the steps below:
57

68
1. [install karma]
79

810
2. install the qunit plugin
911

10-
```bash
11-
npm install karma-qunit --save-dev
12-
```
12+
```bash
13+
npm install karma-qunit --save-dev
14+
```
1315

1416
3. install the ember preprocessor plugin
1517

16-
```bash
17-
npm install karma-ember-preprocessor --save-dev
18-
```
18+
```bash
19+
npm install karma-ember-preprocessor --save-dev
20+
```
1921

2022
4. generate a configuration file for karma
21-
```bash
22-
karma init
23-
```
24-
note -the above will walk you through the basic setup. An example configuration file that works with ember.js/qunit and phantomjs is below
25-
26-
```javascript
27-
module.exports = function(config) {
28-
config.set({
29-
basePath: 'js',
30-
31-
files: [
32-
'vendor/jquery/jquery.min.js',
33-
'vendor/handlebars/handlebars.js',
34-
'vendor/ember/ember.js',
35-
'app.js',
36-
'tests/*.js',
37-
'templates/*.handlebars'
38-
],
39-
40-
browsers: ['PhantomJS'],
41-
singleRun: true,
42-
autoWatch: false,
43-
44-
frameworks: ['qunit'],
45-
46-
plugins: [
47-
'karma-qunit',
48-
'karma-ember-preprocessor',
49-
'karma-phantomjs-launcher'
50-
],
51-
52-
preprocessors: {
53-
'**/*.handlebars': 'ember'
54-
}
55-
});
56-
};
57-
```
58-
59-
Note - the `files` section above should include all dependencies, ie- jQuery/handlebars/ember.js along with the js and handlebars files required to deploy and run your production ember.js application
60-
61-
Note - when testing ember applications, it is important that karma does not try to run the tests until the ember application has finished initialization. You will need to include a small bootstrap file in the `files` section above to enforce this. Here's an example:
62-
```javascript
63-
__karma__.loaded = function() {};
64-
65-
App.setupForTesting();
66-
App.injectTestHelpers();
67-
68-
//this gate/check is required given that standard practice in Ember tests to is to call
69-
//Ember.reset() in the afterEach/tearDown for each test. Doing so, causes the application
70-
//to 're-initialize', resulting in repeated calls to the initialize function below
71-
var karma_started = false;
72-
App.initializer({
73-
name: "run tests",
74-
initialize: function(container, application) {
75-
if (!karma_started) {
76-
karma_started = true;
77-
__karma__.start();
78-
}
79-
}
80-
});
81-
```
23+
```bash
24+
karma init
25+
```
26+
note -the above will walk you through the basic setup. An example configuration file that works with ember.js/qunit and phantomjs is below
27+
28+
```javascript
29+
module.exports = function(config) {
30+
config.set({
31+
basePath: 'js',
32+
33+
files: [
34+
'vendor/jquery/jquery.min.js',
35+
'vendor/handlebars/handlebars.js',
36+
'vendor/ember/ember.js',
37+
'app.js',
38+
'tests/*.js',
39+
'templates/*.handlebars'
40+
],
41+
42+
browsers: ['PhantomJS'],
43+
singleRun: true,
44+
autoWatch: false,
45+
46+
frameworks: ['qunit'],
47+
48+
plugins: [
49+
'karma-qunit',
50+
'karma-ember-preprocessor',
51+
'karma-phantomjs-launcher'
52+
],
53+
54+
preprocessors: {
55+
'**/*.handlebars': 'ember'
56+
}
57+
});
58+
};
59+
```
60+
61+
Note - the `files` section above should include all dependencies, ie- jQuery/handlebars/ember.js along with the js and handlebars files required to deploy and run your production ember.js application
62+
63+
Note - when testing ember applications, it is important that karma does not try to run the tests until the ember application has finished initialization. You will need to include a small bootstrap file in the `files` section above to enforce this. Here's an example:
64+
```javascript
65+
__karma__.loaded = function() {};
66+
67+
App.setupForTesting();
68+
App.injectTestHelpers();
69+
70+
//this gate/check is required given that standard practice in Ember tests to is to call
71+
//Ember.reset() in the afterEach/tearDown for each test. Doing so, causes the application
72+
//to 're-initialize', resulting in repeated calls to the initialize function below
73+
var karma_started = false;
74+
App.initializer({
75+
name: "run tests",
76+
initialize: function(container, application) {
77+
if (!karma_started) {
78+
karma_started = true;
79+
__karma__.start();
80+
}
81+
}
82+
});
83+
```
8284

8385
5. add a simple Qunit test
8486

85-
```javascript
86-
test('one should equal one', function() {
87-
equal(1, 1, 'error: one did not equal one');
88-
});
89-
```
87+
```javascript
88+
test('one should equal one', function() {
89+
equal(1, 1, 'error: one did not equal one');
90+
});
91+
```
9092

9193
6. run the tests with karma from the command line
92-
```bash
93-
karma start
94-
```
94+
```bash
95+
karma start
96+
```
9597

9698
A simple unit / integration tested example app showing karma / qunit / ember in action can be found [here]
9799

docs/plus/09-codio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Codio] is a web-based cloud integrated development environment that supports almost any programming language. Every project gets its individual Box: an instantly available server-side development environment with full terminal access. Unlimited panels and tabs, and a plethora of productivity features.
22

3-
##Customize your Codio Project
3+
## Customize your Codio Project
44

55
Next to the help menu you will see the "Configure" option, if you don't see it click the little arrow near the end and then select "Configure".
66

docs/plus/10-teamcity.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
pageTitle: TeamCity
23
menuTitle: TeamCity
4+
---
35

46
Running Karma in your [TeamCity] build is as simple as adding command line build
57
step to perform the task. That is basically it.

0 commit comments

Comments
 (0)