Skip to content

Commit

Permalink
Merge pull request #233 from brettz9/options-in-docs
Browse files Browse the repository at this point in the history
"Options" heading in doc files (and consistent level 2 heading)
  • Loading branch information
lo1tuma authored Feb 17, 2020
2 parents 347d544 + 7254907 commit 6ac703b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/rules/max-top-level-suites.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ describe('foo', function () {
});
```

## Options

If you want to change the suite limit to, for instance, 2 suites per file:

```js
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-exclusive-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ suite.skip("bar", function () {});
test.skip("bar", function () {});
```

# Options
## Settings

This rule supports the following shared configuration options:
This rule supports the following shared configuration setting:

* `additionalTestFunctions`: An array of extra test functions to protect. This might be used with a custom Mocha extension, such as [`ember-mocha`](https://github.com/switchfly/ember-mocha)

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-hooks-for-single-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('foo', function () {
});
```

# Options
## Options

This rule supports the following options:

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-skipped-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ suite.only("bar", function () {});
test.only("bar", function () {});
```

# Options
## Settings

This rule supports the following shared configuration options:
This rule supports the following shared configuration settings:

* `additionalTestFunctions`: An array of extra test functions to protect. This might be used with a custom Mocha extension, such as [`ember-mocha`](https://github.com/switchfly/ember-mocha)
* `additionalXFunctions`: An array of extra x-function to protect
Expand Down
5 changes: 3 additions & 2 deletions docs/rules/no-synchronous-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ By default, this rule looks for the presence of one of:
- An async function provided to a mocha test statement.
- A return statement within the function body of any mocha test statement.

If none of these three options is used in a test method, the rule will raise a warning.
If none of these three alternatives is used in a test method, the rule will raise a warning.

The following patterns are considered warnings:

Expand Down Expand Up @@ -40,6 +40,8 @@ it('should do foo', function () {
});
```

## Options

You can change the acceptable asynchronous test methods to only allow a combination of async functions/callbacks/promises:

```js
Expand All @@ -48,7 +50,6 @@ rules: {
},
```


### Caveats:

This rule cannot guarantee that a returned function call is actually a promise, it only confirms that the return was made.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/valid-suite-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ context("Test suite", function() { });
suite("Test suite", function() { });
```

## Options

There is also possible to configure a custom list of suite names and a custom error message via the second and third rule configuration option:

```js
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/valid-test-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This rule enforces the test descriptions to follow the desired format.
By default, the regular expression is configured to be "^should" which requires test descriptions to start with "should".
By default, the rule supports "it", "specify" and "test" test function names, but it can be configured to look for different test names via rule configuration.

## Options

Example of a custom rule configuration:

```js
Expand Down

0 comments on commit 6ac703b

Please sign in to comment.