Skip to content

Commit 59f6e3f

Browse files
carolstrancpojer
authored andcommitted
Docs: Removed condescending language (#9040)
* Round 1 - simply, just * Round 2 - easy, easily, of course, simple
1 parent 8d47ffa commit 59f6e3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+185
-185
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Ran all test suites.
121121

122122
##### Using jest-circus
123123

124-
There may be cases where you want to run jest using `jest-circus` instead of `jest-jasmine2` (which is the default runner) for integration testing. In situations like this just set the environment variable `JEST_CIRCUS` to 1. That will configure jest to use `jest-circus`. So something like this.
124+
There may be cases where you want to run jest using `jest-circus` instead of `jest-jasmine2` (which is the default runner) for integration testing. In situations like this, set the environment variable `JEST_CIRCUS` to 1. That will configure jest to use `jest-circus`. So something like this.
125125

126126
```bash
127127
JEST_CIRCUS=1 yarn jest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module.exports = {
190190
};
191191
```
192192

193-
Note, there are some [caveats](https://babeljs.io/docs/en/next/babel-plugin-transform-typescript.html#caveats) to using TypeScript with Babel. Because TypeScript support in Babel is just transpilation, Jest will not type-check your tests as they are ran. If you want that, you can use [ts-jest](https://github.com/kulshekhar/ts-jest).
193+
Note, there are some [caveats](https://babeljs.io/docs/en/next/babel-plugin-transform-typescript.html#caveats) to using TypeScript with Babel. Because TypeScript support in Babel is transpilation, Jest will not type-check your tests as they are ran. If you want that, you can use [ts-jest](https://github.com/kulshekhar/ts-jest).
194194

195195
<!-- end copied -->
196196

docs/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test('if utils mocked automatically', () => {
8686
expect(utils.isAuthorized.mock).toBeTruthy();
8787

8888
// You can provide them with your own implementation
89-
// or just pass the expected return value
89+
// or pass the expected return value
9090
utils.authorize.mockReturnValue('mocked_token');
9191
utils.isAuthorized.mockReturnValue(true);
9292

docs/Es6ClassMocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('When SoundPlayer throws an error', () => {
190190

191191
## In depth: Understanding mock constructor functions
192192

193-
Building your constructor function mock using `jest.fn().mockImplementation()` makes mocks appear more complicated than they really are. This section shows how you can create your own simple mocks to illustrate how mocking works.
193+
Building your constructor function mock using `jest.fn().mockImplementation()` makes mocks appear more complicated than they really are. This section shows how you can create your own smaller mocks to illustrate how mocking works.
194194

195195
### Manual mock that is another ES6 class
196196

@@ -211,7 +211,7 @@ export default class SoundPlayer {
211211
}
212212
```
213213

214-
### Simple mock using module factory parameter
214+
### Mock using module factory parameter
215215

216216
The module factory function passed to `jest.mock(path, moduleFactory)` can be a HOF that returns a function\*. This will allow calling `new` on the mock. Again, this allows you to inject different behavior for testing, but does not provide a way to spy on calls.
217217

docs/ExpectAPI.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ When an assertion fails, the error message should give as much signal as necessa
207207

208208
To use snapshot testing inside of your custom matcher you can import `jest-snapshot` and use it from within your matcher.
209209

210-
Here's a simple snapshot matcher that trims a string to store for a given length, `.toMatchTrimmedSnapshot(length)`:
210+
Here's a snapshot matcher that trims a string to store for a given length, `.toMatchTrimmedSnapshot(length)`:
211211

212212
```js
213213
const {toMatchSnapshot} = require('jest-snapshot');
@@ -798,7 +798,7 @@ const houseForSale = {
798798
};
799799

800800
test('this house has my desired features', () => {
801-
// Simple Referencing
801+
// Example Referencing
802802
expect(houseForSale).toHaveProperty('bath');
803803
expect(houseForSale).toHaveProperty('bedrooms', 4);
804804

@@ -838,7 +838,7 @@ The optional `numDigits` argument limits the number of digits to check **after**
838838
Intuitive equality comparisons often fail, because arithmetic on decimal (base 10) values often have rounding errors in limited precision binary (base 2) representation. For example, this test fails:
839839

840840
```js
841-
test('adding works sanely with simple decimals', () => {
841+
test('adding works sanely with decimals', () => {
842842
expect(0.2 + 0.1).toBe(0.3); // Fails!
843843
});
844844
```
@@ -848,7 +848,7 @@ It fails because in JavaScript, `0.2 + 0.1` is actually `0.30000000000000004`.
848848
For example, this test passes with a precision of 5 digits:
849849

850850
```js
851-
test('adding works sanely with simple decimals', () => {
851+
test('adding works sanely with decimals', () => {
852852
expect(0.2 + 0.1).toBeCloseTo(0.3, 5);
853853
});
854854
```
@@ -857,7 +857,7 @@ Because floating point errors are the problem that `toBeCloseTo` solves, it does
857857

858858
### `.toBeDefined()`
859859

860-
Use `.toBeDefined` to check that a variable is not undefined. For example, if you just want to check that a function `fetchNewFlavorIdea()` returns _something_, you can write:
860+
Use `.toBeDefined` to check that a variable is not undefined. For example, if you want to check that a function `fetchNewFlavorIdea()` returns _something_, you can write:
861861

862862
```js
863863
test('there is a new flavor idea', () => {
@@ -869,7 +869,7 @@ You could write `expect(fetchNewFlavorIdea()).not.toBe(undefined)`, but it's bet
869869

870870
### `.toBeFalsy()`
871871

872-
Use `.toBeFalsy` when you don't care what a value is, you just want to ensure a value is false in a boolean context. For example, let's say you have some application code that looks like:
872+
Use `.toBeFalsy` when you don't care what a value is and you want to ensure a value is false in a boolean context. For example, let's say you have some application code that looks like:
873873

874874
```js
875875
drinkSomeLaCroix();
@@ -957,7 +957,7 @@ test('bloop returns null', () => {
957957

958958
### `.toBeTruthy()`
959959

960-
Use `.toBeTruthy` when you don't care what a value is, you just want to ensure a value is true in a boolean context. For example, let's say you have some application code that looks like:
960+
Use `.toBeTruthy` when you don't care what a value is and you want to ensure a value is true in a boolean context. For example, let's say you have some application code that looks like:
961961

962962
```js
963963
drinkSomeLaCroix();
@@ -966,7 +966,7 @@ if (thirstInfo()) {
966966
}
967967
```
968968

969-
You may not care what `thirstInfo` returns, specifically - it might return `true` or a complex object, and your code would still work. So if you just want to test that `thirstInfo` will be truthy after drinking some La Croix, you could write:
969+
You may not care what `thirstInfo` returns, specifically - it might return `true` or a complex object, and your code would still work. So if you want to test that `thirstInfo` will be truthy after drinking some La Croix, you could write:
970970

971971
```js
972972
test('drinking La Croix leads to having thirst info', () => {

docs/GettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ module.exports = {
175175
};
176176
```
177177

178-
However, there are some [caveats](https://babeljs.io/docs/en/next/babel-plugin-transform-typescript.html#caveats) to using TypeScript with Babel. Because TypeScript support in Babel is just transpilation, Jest will not type-check your tests as they are ran. If you want that, you can use [ts-jest](https://github.com/kulshekhar/ts-jest).
178+
However, there are some [caveats](https://babeljs.io/docs/en/next/babel-plugin-transform-typescript.html#caveats) to using TypeScript with Babel. Because TypeScript support in Babel is transpilation, Jest will not type-check your tests as they are ran. If you want that, you can use [ts-jest](https://github.com/kulshekhar/ts-jest).

docs/GlobalAPI.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ test('can find things', () => {
123123
});
124124
```
125125

126-
Here the `beforeAll` ensures that the database is set up before tests run. If setup was synchronous, you could just do this without `beforeAll`. The key is that Jest will wait for a promise to resolve, so you can have asynchronous setup as well.
126+
Here the `beforeAll` ensures that the database is set up before tests run. If setup was synchronous, you could do this without `beforeAll`. The key is that Jest will wait for a promise to resolve, so you can have asynchronous setup as well.
127127

128128
If `beforeAll` is inside a `describe` block, it runs at the beginning of the describe block.
129129

@@ -190,7 +190,7 @@ describe('my beverage', () => {
190190
});
191191
```
192192

193-
This isn't required - you can just write the `test` blocks directly at the top level. But this can be handy if you prefer your tests to be organized into groups.
193+
This isn't required - you can write the `test` blocks directly at the top level. But this can be handy if you prefer your tests to be organized into groups.
194194

195195
You can also nest `describe` blocks if you have a hierarchy of tests:
196196

@@ -388,7 +388,7 @@ describe.skip('my other beverage', () => {
388388
});
389389
```
390390

391-
Using `describe.skip` is often just an easier alternative to temporarily commenting out a chunk of tests.
391+
Using `describe.skip` is often a cleaner alternative to temporarily commenting out a chunk of tests.
392392

393393
### `describe.skip.each(table)(name, fn)`
394394

@@ -544,7 +544,7 @@ test('it is not snowing', () => {
544544

545545
Only the "it is raining" test will run in that test file, since it is run with `test.only`.
546546

547-
Usually you wouldn't check code using `test.only` into source control - you would use it just for debugging, and remove it once you have fixed the broken tests.
547+
Usually you wouldn't check code using `test.only` into source control - you would use it for debugging, and remove it once you have fixed the broken tests.
548548

549549
### `test.only.each(table)(name, fn)`
550550

@@ -590,7 +590,7 @@ test('will not be ran', () => {
590590

591591
Also under the aliases: `it.skip(name, fn)` or `xit(name, fn)` or `xtest(name, fn)`
592592

593-
When you are maintaining a large codebase, you may sometimes find a test that is temporarily broken for some reason. If you want to skip running this test, but you don't want to just delete this code, you can use `test.skip` to specify some tests to skip.
593+
When you are maintaining a large codebase, you may sometimes find a test that is temporarily broken for some reason. If you want to skip running this test, but you don't want to delete this code, you can use `test.skip` to specify some tests to skip.
594594

595595
For example, let's say you had these tests:
596596

@@ -606,7 +606,7 @@ test.skip('it is not snowing', () => {
606606

607607
Only the "it is raining" test will run, since the other test is run with `test.skip`.
608608

609-
You could simply comment the test out, but it's often a bit nicer to use `test.skip` because it will maintain indentation and syntax highlighting.
609+
You could comment the test out, but it's often a bit nicer to use `test.skip` because it will maintain indentation and syntax highlighting.
610610

611611
### `test.skip.each(table)(name, fn)`
612612

docs/ManualMocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('listFilesInDirectorySync', () => {
124124
});
125125
```
126126

127-
The example mock shown here uses [`jest.genMockFromModule`](JestObjectAPI.md#jestgenmockfrommodulemodulename) to generate an automatic mock, and overrides its default behavior. This is the recommended approach, but is completely optional. If you do not want to use the automatic mock at all, you can simply export your own functions from the mock file. One downside to fully manual mocks is that they're manual – meaning you have to manually update them any time the module they are mocking changes. Because of this, it's best to use or extend the automatic mock when it works for your needs.
127+
The example mock shown here uses [`jest.genMockFromModule`](JestObjectAPI.md#jestgenmockfrommodulemodulename) to generate an automatic mock, and overrides its default behavior. This is the recommended approach, but is completely optional. If you do not want to use the automatic mock at all, you can export your own functions from the mock file. One downside to fully manual mocks is that they're manual – meaning you have to manually update them any time the module they are mocking changes. Because of this, it's best to use or extend the automatic mock when it works for your needs.
128128

129129
To ensure that a manual mock and its real implementation stay in sync, it might be useful to require the real module using [`jest.requireActual(moduleName)`](JestObjectAPI.md#jestrequireactualmodulename) in your manual mock and amending it with mock functions before exporting it.
130130

docs/MigrationGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Migrating to Jest
55

66
If you'd like to try out Jest with an existing codebase, there are a number of ways to convert to Jest:
77

8-
- If you are using Jasmine, or a Jasmine like API (for example [Mocha](https://mochajs.org)), Jest should be mostly compatible and easy to migrate to.
8+
- If you are using Jasmine, or a Jasmine like API (for example [Mocha](https://mochajs.org)), Jest should be mostly compatible, which makes it less complicated to migrate to.
99
- If you are using AVA, Expect.js (by Automattic), Jasmine, Mocha, proxyquire, Should.js or Tape you can automatically migrate with Jest Codemods (see below).
1010
- If you like [chai](http://chaijs.com/), you can upgrade to Jest and continue using chai. However, we recommend trying out Jest's assertions and their failure messages. Jest Codemods can migrate from chai (see below).
1111

docs/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: mock-function-api
33
title: Mock Functions
44
---
55

6-
Mock functions are also known as "spies", because they let you spy on the behavior of a function that is called indirectly by some other code, rather than just testing the output. You can create a mock function with `jest.fn()`. If no implementation is given, the mock function will return `undefined` when invoked.
6+
Mock functions are also known as "spies", because they let you spy on the behavior of a function that is called indirectly by some other code, rather than only testing the output. You can create a mock function with `jest.fn()`. If no implementation is given, the mock function will return `undefined` when invoked.
77

88
## Methods
99

0 commit comments

Comments
 (0)