Skip to content

Commit

Permalink
upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 30, 2018
1 parent 644dd0d commit e3989ed
Show file tree
Hide file tree
Showing 88 changed files with 1,812 additions and 1,793 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Why does this feature belong in the [Jest core platform](https://www.youtube.com

Common feature proposals that do not typically make it to core:

* New matchers (see [jest-extended](https://github.com/jest-community/jest-extended))
* Changes to the default reporter (use custom reporters instead)
* Changes to node/jsdom test environments (use custom environments instead)
- New matchers (see [jest-extended](https://github.com/jest-community/jest-extended))
- Changes to the default reporter (use custom reporters instead)
- Changes to node/jsdom test environments (use custom environments instead)
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ about: If you have questions, please check our Discord or StackOverflow

For questions or help please see:

* [The Jest help page](https://facebook.github.io/jest/en/help.html)
* [Our discord channel in Reactiflux](https://discord.gg/MWRhKCj)
* The [jestjs](https://stackoverflow.com/questions/tagged/jestjs) tag on [StackOverflow](https://stackoverflow.com/questions/ask)
- [The Jest help page](https://facebook.github.io/jest/en/help.html)
- [Our discord channel in Reactiflux](https://discord.gg/MWRhKCj)
- The [jestjs](https://stackoverflow.com/questions/tagged/jestjs) tag on [StackOverflow](https://stackoverflow.com/questions/ask)
1,850 changes: 925 additions & 925 deletions CHANGELOG.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ cd /path/to/another/project
jest [options] # run jest-cli/bin/jest.js in the development build
```
* To decide whether to specify any options, see `test` under `scripts` in the `package.json` file of the other project.
- To decide whether to specify any options, see `test` under `scripts` in the `package.json` file of the other project.
To unlink `jest` on the command line from `jest-cli/bin/jest.js` in a development build:
Expand All @@ -136,18 +136,18 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe

## How to Get in Touch

* Discord - [#jest](https://discord.gg/MWRhKCj) on [Reactiflux](http://www.reactiflux.com/)
- Discord - [#jest](https://discord.gg/MWRhKCj) on [Reactiflux](http://www.reactiflux.com/)

## Code Conventions

* 2 spaces for indentation (no tabs).
* 80 character line length strongly preferred.
* Prefer `'` over `"`.
* ES6 syntax when possible.
* Use [Flow types](http://flowtype.org/).
* Use semicolons;
* Trailing commas,
* Avd abbr wrds.
- 2 spaces for indentation (no tabs).
- 80 character line length strongly preferred.
- Prefer `'` over `"`.
- ES6 syntax when possible.
- Use [Flow types](http://flowtype.org/).
- Use semicolons;
- Trailing commas,
- Avd abbr wrds.
## License
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

🃏 Delightful JavaScript Testing

* **👩🏻‍💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project.
- **👩🏻‍💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project.

* **🏃🏽 Instant Feedback**: Fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly.
- **🏃🏽 Instant Feedback**: Fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly.

* **📸 Snapshot Testing**: Capture snapshots of React trees or other serializable values to simplify testing and to analyze how state changes over time.
- **📸 Snapshot Testing**: Capture snapshots of React trees or other serializable values to simplify testing and to analyze how state changes over time.

## Getting Started

Expand Down Expand Up @@ -142,10 +142,10 @@ To use TypeScript in your tests you can use [ts-jest](https://github.com/kulshek
Learn more about using [Jest on the official site!](http://facebook.github.io/jest)
* [Getting Started](http://facebook.github.io/jest/docs/en/getting-started.html)
* [Guides](http://facebook.github.io/jest/docs/en/snapshot-testing.html)
* [API Reference](http://facebook.github.io/jest/docs/en/api.html)
* [Configuring Jest](http://facebook.github.io/jest/docs/en/configuration.html)
- [Getting Started](http://facebook.github.io/jest/docs/en/getting-started.html)
- [Guides](http://facebook.github.io/jest/docs/en/snapshot-testing.html)
- [API Reference](http://facebook.github.io/jest/docs/en/api.html)
- [Configuring Jest](http://facebook.github.io/jest/docs/en/configuration.html)
## Badge
Expand Down
28 changes: 14 additions & 14 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ For example, with the following configuration:

Jest will fail if:

* The `./src/components` directory has less than 40% branch or statement coverage.
* One of the files matching the `./src/reducers/**/*.js` glob has less than 90% statement coverage.
* The `./src/api/very-important-module.js` file has less than 100% coverage.
* Every remaining file combined has less than 50% coverage (`global`).
- The `./src/components` directory has less than 40% branch or statement coverage.
- One of the files matching the `./src/reducers/**/*.js` glob has less than 90% statement coverage.
- The `./src/api/very-important-module.js` file has less than 100% coverage.
- Every remaining file combined has less than 50% coverage (`global`).

### `forceCoverageMatch` [array<string>]

Expand Down Expand Up @@ -375,12 +375,12 @@ Specifies notification mode. Requires `notify: true`.

#### Modes

* `always`: always send a notification.
* `failure`: send a notification when tests fail.
* `success`: send a notification when tests pass.
* `change`: send a notification when the status changed.
* `success-change`: send a notification when tests pass or once when it fails.
* `failure-success`: send a notification when tests fails or once when it passes.
- `always`: always send a notification.
- `failure`: send a notification when tests fail.
- `success`: send a notification when tests pass.
- `change`: send a notification when the status changed.
- `success-change`: send a notification when tests pass or once when it fails.
- `failure-success`: send a notification when tests fails or once when it passes.

### `preset` [string]

Expand Down Expand Up @@ -566,10 +566,10 @@ Default: `"jest-runner"`

This option allows you to use a custom runner instead of Jest's default test runner. Examples of runners include:

* [`jest-runner-eslint`](https://github.com/jest-community/jest-runner-eslint)
* [`jest-runner-mocha`](https://github.com/rogeliog/jest-runner-mocha)
* [`jest-runner-tsc`](https://github.com/azz/jest-runner-tsc)
* [`jest-runner-prettier`](https://github.com/keplersj/jest-runner-prettier)
- [`jest-runner-eslint`](https://github.com/jest-community/jest-runner-eslint)
- [`jest-runner-mocha`](https://github.com/rogeliog/jest-runner-mocha)
- [`jest-runner-tsc`](https://github.com/azz/jest-runner-tsc)
- [`jest-runner-prettier`](https://github.com/keplersj/jest-runner-prettier)

To write a test-runner, export a class with which accepts `globalConfig` in the constructor, and has a `runTests` method with the signature:

Expand Down
18 changes: 9 additions & 9 deletions docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ test('randocall calls its callback with a number', () => {

You can use it instead of a literal value:

* in `toEqual` or `toBeCalledWith`
* to match a property in `objectContaining` or `toMatchObject`
- in `toEqual` or `toBeCalledWith`
- to match a property in `objectContaining` or `toMatchObject`

```js
describe('arrayContaining', () => {
Expand Down Expand Up @@ -358,9 +358,9 @@ test('onPress gets called with the right thing', () => {

You can use it instead of a literal value:

* in `toEqual` or `toBeCalledWith`
* to match an element in `arrayContaining`
* to match a property in `objectContaining` or `toMatchObject`
- in `toEqual` or `toBeCalledWith`
- to match an element in `arrayContaining`
- to match a property in `objectContaining` or `toMatchObject`

This example also shows how you can nest multiple asymmetric matchers, with `expect.stringMatching` inside the `expect.arrayContaining`.

Expand Down Expand Up @@ -398,8 +398,8 @@ expect.addSnapshotSerializer(serializer);

If you add a snapshot serializer in individual test files instead of to adding it to `snapshotSerializers` configuration:

* You make the dependency explicit instead of implicit.
* You avoid limits to configuration that might cause you to eject from [create-react-app](https://github.com/facebookincubator/create-react-app).
- You make the dependency explicit instead of implicit.
- You avoid limits to configuration that might cause you to eject from [create-react-app](https://github.com/facebookincubator/create-react-app).

See [configuring Jest](Configuration.md#snapshotserializers-array-string) for more information.

Expand Down Expand Up @@ -1037,8 +1037,8 @@ Use `.toStrictEqual` to test that objects have the same types as well as structu

Differences from `.toEqual`:

* Keys with `undefined` properties are checked. e.g. `{a: undefined, b: 2}` does not match `{b: 2}` when using `.toStrictEqual`.
* Object types are checked to be equal. e.g. A class instance with fields `a` and `b` will not equal a literal object with fields `a` and `b`.
- Keys with `undefined` properties are checked. e.g. `{a: undefined, b: 2}` does not match `{b: 2}` when using `.toStrictEqual`.
- Object types are checked to be equal. e.g. A class instance with fields `a` and `b` will not equal a literal object with fields `a` and `b`.

```js
class LaCroix {
Expand Down
64 changes: 32 additions & 32 deletions docs/GlobalAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ Use `describe.each` if you keep duplicating the same test suites with different

#### 1. `describe.each(table)(name, fn)`

* `table`: `Array` of Arrays with the arguments that are passed into the `fn` for each row.
* `name`: `String` the title of the test suite.
* Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args):
* `%s`- String.
* `%d`- Number.
* `%i` - Integer.
* `%f` - Floating point value.
* `%j` - JSON.
* `%o` - Object.
* `%%` - single percent sign ('%'). This does not consume an argument.
* `fn`: `Function` the suite of tests to be ran, this is the function that will receive the parameters in each row as function arguments.
- `table`: `Array` of Arrays with the arguments that are passed into the `fn` for each row.
- `name`: `String` the title of the test suite.
- Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args):
- `%s`- String.
- `%d`- Number.
- `%i` - Integer.
- `%f` - Floating point value.
- `%j` - JSON.
- `%o` - Object.
- `%%` - single percent sign ('%'). This does not consume an argument.
- `fn`: `Function` the suite of tests to be ran, this is the function that will receive the parameters in each row as function arguments.

Example:

Expand All @@ -265,11 +265,11 @@ describe.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])(

#### 2. `` describe.each`table`(name, fn) ``

* `table`: `Tagged Template Literal`
* First row of variable name column headings separated with `|`
* One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
* `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions.
* `fn`: `Function` the suite of tests to be ran, this is the function that will receive the test data object.
- `table`: `Tagged Template Literal`
- First row of variable name column headings separated with `|`
- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
- `name`: `String` the title of the test suite, use `$variable` to inject test data into the suite title from the tagged template expressions.
- `fn`: `Function` the suite of tests to be ran, this is the function that will receive the test data object.

Example:

Expand Down Expand Up @@ -474,17 +474,17 @@ Use `test.each` if you keep duplicating the same test with different data. `test

#### 1. `test.each(table)(name, fn)`

* `table`: `Array` of Arrays with the arguments that are passed into the test `fn` for each row.
* `name`: `String` the title of the test block.
* Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args):
* `%s`- String.
* `%d`- Number.
* `%i` - Integer.
* `%f` - Floating point value.
* `%j` - JSON.
* `%o` - Object.
* `%%` - single percent sign ('%'). This does not consume an argument.
* `fn`: `Function` the test to be ran, this is the function that will receive the parameters in each row as function arguments.
- `table`: `Array` of Arrays with the arguments that are passed into the test `fn` for each row.
- `name`: `String` the title of the test block.
- Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args):
- `%s`- String.
- `%d`- Number.
- `%i` - Integer.
- `%f` - Floating point value.
- `%j` - JSON.
- `%o` - Object.
- `%%` - single percent sign ('%'). This does not consume an argument.
- `fn`: `Function` the test to be ran, this is the function that will receive the parameters in each row as function arguments.

Example:

Expand All @@ -499,11 +499,11 @@ test.each([[1, 1, 2], [1, 2, 3], [2, 1, 3]])(

#### 2. `` test.each`table`(name, fn) ``

* `table`: `Tagged Template Literal`
* First row of variable name column headings separated with `|`
* One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
* `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions.
* `fn`: `Function` the test to be ran, this is the function that will receive the test data object.
- `table`: `Tagged Template Literal`
- First row of variable name column headings separated with `|`
- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax.
- `name`: `String` the title of the test, use `$variable` to inject test data into the test title from the tagged template expressions.
- `fn`: `Function` the test to be ran, this is the function that will receive the test data object.

Example:

Expand Down
8 changes: 4 additions & 4 deletions docs/JestCommunity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ The community around Jest is working hard to make the testing experience even gr

[jest-community](https://github.com/jest-community) is a new GitHub organization for high quality Jest additions curated by Jest maintainers and collaborators. It already features some of our favorite projects, to name a few:

* [vscode-jest](https://github.com/jest-community/vscode-jest)
* [jest-extended](https://github.com/jest-community/jest-extended)
* [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)
* [awesome-jest](https://github.com/jest-community/awesome-jest)
- [vscode-jest](https://github.com/jest-community/vscode-jest)
- [jest-extended](https://github.com/jest-community/jest-extended)
- [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)
- [awesome-jest](https://github.com/jest-community/awesome-jest)

Community projects under one organisation are a great way for Jest to experiment with new ideas/techniques and approaches. Encourage contributions from the community and publish contributions independently at a faster pace.

Expand Down
48 changes: 24 additions & 24 deletions docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ The `jest` object is automatically in scope within every test file. The methods

## Methods

* [`jest.clearAllTimers()`](#jestclearalltimers)
* [`jest.disableAutomock()`](#jestdisableautomock)
* [`jest.enableAutomock()`](#jestenableautomock)
* [`jest.fn(implementation)`](#jestfnimplementation)
* [`jest.isMockFunction(fn)`](#jestismockfunctionfn)
* [`jest.genMockFromModule(moduleName)`](#jestgenmockfrommodulemodulename)
* [`jest.mock(moduleName, factory, options)`](#jestmockmodulename-factory-options)
* [`jest.unmock(moduleName)`](#jestunmockmodulename)
* [`jest.doMock(moduleName, factory, options)`](#jestdomockmodulename-factory-options)
* [`jest.dontMock(moduleName)`](#jestdontmockmodulename)
* [`jest.clearAllMocks()`](#jestclearallmocks)
* [`jest.resetAllMocks()`](#jestresetallmocks)
* [`jest.restoreAllMocks()`](#jestrestoreallmocks)
* [`jest.resetModules()`](#jestresetmodules)
* [`jest.runAllTicks()`](#jestrunallticks)
* [`jest.runAllTimers()`](#jestrunalltimers)
* [`jest.advanceTimersByTime(msToRun)`](#jestadvancetimersbytimemstorun)
* [`jest.runOnlyPendingTimers()`](#jestrunonlypendingtimers)
* [`jest.setMock(moduleName, moduleExports)`](#jestsetmockmodulename-moduleexports)
* [`jest.setTimeout(timeout)`](#jestsettimeouttimeout)
* [`jest.useFakeTimers()`](#jestusefaketimers)
* [`jest.useRealTimers()`](#jestuserealtimers)
* [`jest.spyOn(object, methodName)`](#jestspyonobject-methodname)
* [`jest.spyOn(object, methodName, accessType?)`](#jestspyonobject-methodname-accesstype)
- [`jest.clearAllTimers()`](#jestclearalltimers)
- [`jest.disableAutomock()`](#jestdisableautomock)
- [`jest.enableAutomock()`](#jestenableautomock)
- [`jest.fn(implementation)`](#jestfnimplementation)
- [`jest.isMockFunction(fn)`](#jestismockfunctionfn)
- [`jest.genMockFromModule(moduleName)`](#jestgenmockfrommodulemodulename)
- [`jest.mock(moduleName, factory, options)`](#jestmockmodulename-factory-options)
- [`jest.unmock(moduleName)`](#jestunmockmodulename)
- [`jest.doMock(moduleName, factory, options)`](#jestdomockmodulename-factory-options)
- [`jest.dontMock(moduleName)`](#jestdontmockmodulename)
- [`jest.clearAllMocks()`](#jestclearallmocks)
- [`jest.resetAllMocks()`](#jestresetallmocks)
- [`jest.restoreAllMocks()`](#jestrestoreallmocks)
- [`jest.resetModules()`](#jestresetmodules)
- [`jest.runAllTicks()`](#jestrunallticks)
- [`jest.runAllTimers()`](#jestrunalltimers)
- [`jest.advanceTimersByTime(msToRun)`](#jestadvancetimersbytimemstorun)
- [`jest.runOnlyPendingTimers()`](#jestrunonlypendingtimers)
- [`jest.setMock(moduleName, moduleExports)`](#jestsetmockmodulename-moduleexports)
- [`jest.setTimeout(timeout)`](#jestsettimeouttimeout)
- [`jest.useFakeTimers()`](#jestusefaketimers)
- [`jest.useRealTimers()`](#jestuserealtimers)
- [`jest.spyOn(object, methodName)`](#jestspyonobject-methodname)
- [`jest.spyOn(object, methodName, accessType?)`](#jestspyonobject-methodname-accesstype)

---

Expand Down
8 changes: 4 additions & 4 deletions docs/JestPlatform.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ You can cherry pick specific features of Jest and use them as standalone package

Tool for identifying modified files in a git/hg repository. Exports two functions:

* `getChangedFilesForRoots` returns a promise that resolves to an object with the changed files and repos.
* `findRepos` returns a promise that resolves to a set of repositories contained in the specified path.
- `getChangedFilesForRoots` returns a promise that resolves to an object with the changed files and repos.
- `findRepos` returns a promise that resolves to a set of repositories contained in the specified path.

### Example

Expand Down Expand Up @@ -95,8 +95,8 @@ console.log(getType(undefinedValue));

Tool for validating configurations submitted by users. Exports a function that takes two arguments: the user's configuration and an object containing an example configuration and other options. The return value is an object with two attributes:

* `hasDeprecationWarnings`, a boolean indicating whether the submitted configuration has deprecation warnings,
* `isValid`, a boolean indicating whether the configuration is correct or not.
- `hasDeprecationWarnings`, a boolean indicating whether the submitted configuration has deprecation warnings,
- `isValid`, a boolean indicating whether the configuration is correct or not.

### Example

Expand Down
Loading

0 comments on commit e3989ed

Please sign in to comment.