Skip to content

Commit 244f7dc

Browse files
authored
chore: update to prettier@2 (#9692)
1 parent 1c01e68 commit 244f7dc

110 files changed

Lines changed: 332 additions & 380 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
- image: circleci/node:8
2525
steps:
2626
- checkout
27+
- run:
28+
command: yarn remove-prettier-dep
2729
- restore-cache: *restore-cache
2830
- run: *install
2931
- save-cache: *save-cache

.github/workflows/nodejs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ jobs:
8080
uses: actions/setup-node@v1
8181
with:
8282
node-version: ${{ matrix.node-version }}
83+
- name: remove prettier dep
84+
run: yarn remove-prettier-dep
85+
if: matrix.node-version == '8.17.0'
8386
- name: install
8487
run: yarn install-no-ts-build
8588
- name: run tests

docs/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ module.exports = async () => {
429429

430430
```js
431431
// teardown.js
432-
module.exports = async function() {
432+
module.exports = async function () {
433433
await global.__MONGOD__.stop();
434434
};
435435
```

docs/Es6ClassMocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ In order to mock a constructor function, the module factory must return a constr
221221

222222
```javascript
223223
jest.mock('./sound-player', () => {
224-
return function() {
224+
return function () {
225225
return {playSoundFile: () => {}};
226226
};
227227
});

docs/MockFunctionAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Expected mock function "mockedFunction" to have been called, but it was not call
202202
Syntactic sugar function for:
203203

204204
```js
205-
jest.fn(function() {
205+
jest.fn(function () {
206206
return this;
207207
});
208208
```

docs/MockFunctions.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ const myMock = jest.fn();
8686
console.log(myMock());
8787
// > undefined
8888

89-
myMock
90-
.mockReturnValueOnce(10)
91-
.mockReturnValueOnce('x')
92-
.mockReturnValue(true);
89+
myMock.mockReturnValueOnce(10).mockReturnValueOnce('x').mockReturnValue(true);
9390

9491
console.log(myMock(), myMock(), myMock(), myMock());
9592
// > 10, 'x', true, true
@@ -169,7 +166,7 @@ The `mockImplementation` method is useful when you need to define the default im
169166

170167
```js
171168
// foo.js
172-
module.exports = function() {
169+
module.exports = function () {
173170
// some implementation;
174171
};
175172

@@ -220,7 +217,7 @@ const myObj = {
220217
// is the same as
221218

222219
const otherObj = {
223-
myMethod: jest.fn(function() {
220+
myMethod: jest.fn(function () {
224221
return this;
225222
}),
226223
};

docs/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const os = require('os');
6363

6464
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
6565

66-
module.exports = async function() {
66+
module.exports = async function () {
6767
const browser = await puppeteer.launch();
6868
// store the browser instance so we can teardown it later
6969
// this global is only available in the teardown but not in TestEnvironments
@@ -127,7 +127,7 @@ const rimraf = require('rimraf');
127127
const path = require('path');
128128

129129
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
130-
module.exports = async function() {
130+
module.exports = async function () {
131131
// close the browser instance
132132
await global.__BROWSER_GLOBAL__.close();
133133

e2e/MockStdinWatchPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MockStdinWatchPlugin {
1212
constructor({stdin, config}) {
1313
this._stdin = stdin;
1414
if (typeof this._stdin.setRawMode !== 'function') {
15-
this._stdin.setRawMode = function() {};
15+
this._stdin.setRawMode = function () {};
1616
}
1717
this._config = config;
1818
}

e2e/__tests__/environmentAfterTeardown.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import runJest from '../runJest';
1010

1111
test('prints useful error for environment methods after test is done', () => {
1212
const {stderr} = runJest('environment-after-teardown');
13-
const interestingLines = stderr
14-
.split('\n')
15-
.slice(9, 18)
16-
.join('\n');
13+
const interestingLines = stderr.split('\n').slice(9, 18).join('\n');
1714

1815
expect(wrap(interestingLines)).toMatchSnapshot();
1916
expect(stderr.split('\n')[9]).toBe(

e2e/__tests__/listTests.test.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ describe('--listTests flag', () => {
2424

2525
expect(exitCode).toBe(0);
2626
expect(
27-
wrap(
28-
normalizePaths(stdout)
29-
.split('\n')
30-
.sort()
31-
.join('\n'),
32-
),
27+
wrap(normalizePaths(stdout).split('\n').sort().join('\n')),
3328
).toMatchSnapshot();
3429
});
3530

@@ -39,13 +34,7 @@ describe('--listTests flag', () => {
3934
expect(exitCode).toBe(0);
4035
expect(() => JSON.parse(stdout)).not.toThrow();
4136
expect(
42-
wrap(
43-
JSON.stringify(
44-
JSON.parse(stdout)
45-
.map(normalizePaths)
46-
.sort(),
47-
),
48-
),
37+
wrap(JSON.stringify(JSON.parse(stdout).map(normalizePaths).sort())),
4938
).toMatchSnapshot();
5039
});
5140
});

0 commit comments

Comments
 (0)