Skip to content

Commit 93234bd

Browse files
committed
prettier
1 parent 0c8014f commit 93234bd

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- `[jest-core]` Add support for `testResultsProcessor` written in ESM ([#12006](https://github.com/facebook/jest/pull/12006))
66
- `[jest-diff, pretty-format]` Add `compareKeys` option for custom sorting of object keys ([#11992](https://github.com/facebook/jest/pull/11992))
7-
- `[jest-mock]` Add `ts-jest` mock util functions ([#12089](https://github.com/facebook/jest/pull/12089))
7+
- `[jest-mock]` Add `ts-jest` mock util functions ([#12089](https://github.com/facebook/jest/pull/12089))
88

99
### Fixes
1010

docs/JestObjectAPI.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -597,32 +597,31 @@ export const foo = {
597597
},
598598
},
599599
name: () => 'foo',
600-
}
600+
};
601601
```
602602

603603
```ts
604604
// foo.spec.ts
605-
import { foo } from './foo'
606-
jest.mock('./foo')
605+
import {foo} from './foo';
606+
jest.mock('./foo');
607607

608608
// here the whole foo var is mocked deeply
609-
const mockedFoo = jest.mocked(foo, true)
609+
const mockedFoo = jest.mocked(foo, true);
610610

611611
test('deep', () => {
612612
// there will be no TS error here, and you'll have completion in modern IDEs
613-
mockedFoo.a.b.c.hello('me')
613+
mockedFoo.a.b.c.hello('me');
614614
// same here
615-
expect(mockedFoo.a.b.c.hello.mock.calls).toHaveLength(1)
616-
})
615+
expect(mockedFoo.a.b.c.hello.mock.calls).toHaveLength(1);
616+
});
617617

618618
test('direct', () => {
619-
foo.name()
619+
foo.name();
620620
// here only foo.name is mocked (or its methods if it's an object)
621-
expect(mocked(foo.name).mock.calls).toHaveLength(1)
622-
})
621+
expect(mocked(foo.name).mock.calls).toHaveLength(1);
622+
});
623623
```
624624

625-
626625
## Mock Timers
627626

628627
### `jest.useFakeTimers(implementation?: 'modern' | 'legacy')`

0 commit comments

Comments
 (0)