Commit Graph
66 Commits
Author SHA1 Message Date
Mine Starks d161aae164 Merge pull request #23102 from JoshuaKGoldberg/jest-class-names-describe
Allowed functions in jest's describe
2018-03-21 09:09:17 -07:00
Josh Goldberg c631d2f60d Update index.d.ts 2018-03-17 08:12:58 -07:00
Josh Goldberg 8ca6f58232 Re-add TS comment and beforeAll 2018-03-17 08:12:36 -07:00
Ahn 6a0889aef2 Add types for creating async functions in Jest 22.2 2018-03-03 00:02:03 +01:00
Achim Weimert 24b320d5a0 Update jest.clearAllMocks() description
Update the description of `jest.clearAllMocks()` to the one from:
https://facebook.github.io/jest/docs/en/jest-object.html#jestclearallmocks

This also removes the `@deprecated` annotation which seems to have been invalid: The docs don't mention that this method is deprecated.
2018-02-23 16:34:17 +00:00
Mário Gonçalves 2a4504a81d Added test cases 2018-02-16 17:10:21 +00:00
Mário Gonçalves c52bfaf215 [jest] updated toHaveProperty method of Matchers 2018-02-16 17:10:21 +00:00
Andy Hanson 45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Ron Buckton c1801fe71a Merge pull request #23391 from alan-agius4/patch-4
fix(jest): re-add global `spyOn`
2018-02-08 20:33:16 -08:00
Josh Goldberg 2a98920407 Merge branch 'master' 2018-02-08 11:40:47 -08:00
Josh Goldberg 4e7c1db217 Added my name there too; why not? 2018-02-07 16:36:59 -08:00
Josh Goldberg b47fc25da9 Renamed to FunctionLike; allowed Function 2018-02-07 16:36:08 -08:00
Andy bef4d2b27d Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Alan Agius cef3a6f728 Revert "Remove global spyOn, pending, fail (#23226)"
This reverts commit f08ec1c02f.
2018-02-03 18:38:38 +01:00
Ahn f08ec1c02f Remove global spyOn, pending, fail (#23226) 2018-01-29 11:28:32 -08:00
Ahn 29a649e6ab Add accessType to jest.spyOn as supported in Jest 22.1.0+ for types/jest (#23082)
* Add accessType to jest.spyOn

* Adjust version

* Adjust accessType to be more accurate on expected type value
2018-01-23 10:31:06 -08:00
Josh Goldberg 4b3b60fd82 Used a ClassLike interface because of ban-types 2018-01-21 22:05:01 -08:00
Josh Goldberg 983acb1676 Bumped jest version in types to 22.0.5 2018-01-21 19:33:28 -08:00
Josh Goldberg 7ae2eba533 Allowed functions in jest's describe
As of 22.0.5, jest allows classes for describe blocks.
2018-01-21 19:29:28 -08:00
Andy 219dd6df82 Fix 'prefer-readonly' lint failures (#22819) 2018-01-10 14:59:37 -08:00
Chris Mohr 9a4a3b6418 add jest mockName and getMockName (#22682) 2018-01-04 14:31:11 -08:00
Paul van Brenk bb007b76aa Merge pull request #22480 from douglasduteil/patch-1
jest: update ProjectConfig to jest@22.0
2017-12-28 15:40:52 -08:00
Paul van Brenk cd997a796a Merge pull request #22254 from JamieMason/jasmine-matchers
Jasmine matchers can accept many arguments
2017-12-27 16:52:35 -08:00
Douglas Duteil de20d2d9a0 Update index.d.ts 2017-12-23 10:35:19 +01:00
Douglas Duteil 78c5458e43 jest: update ProjectConfig to jest@22.0
From https://github.com/facebook/jest/blob/e879099db1024f106757ee55cb0e9a6935488b43/types/Config.js#L24-L69
2017-12-23 10:31:47 +01:00
Jamie Mason 3bdc4ff651 Jasmine matchers can accept many arguments
refs #21327
2017-12-17 20:49:58 +00:00
Technion a0472cd4d8 Disable style check on jest. 2017-12-14 21:05:56 +00:00
Technion 0e06269e02 Move #19662 fix to a fake interface as per PR discussion. 2017-12-14 10:43:13 +00:00
Technion b580b70dcd Changes Jest type to use array rather than Set.
Set may be technically stricter but as per #19662, there have been a number of associated problems with this.
2017-12-07 04:42:26 +00:00
Benjamin Lichtman 351a125e1f Merge pull request #21676 from knee-cola/master
added `advanceTimersByTime` metod
2017-11-22 20:54:20 -05:00
knee-cola 03bca40577 fixed comment foradvanceTimersByTime method 2017-11-22 09:24:02 +01:00
knee-cola 975bda1663 added advanceTimersByTime metod
previous name for this method was `runTimersToTime` - it was renamed in renamed in Jest 21.3.0+
2017-11-21 17:33:35 +01:00
Josh Goldberg d8652bb065 Made name optional in jest::jasmine::createSpy
See https://github.com/jasmine/jasmine/issues/1438 and https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21159.
2017-11-17 12:06:42 -08:00
Jamie Mason 0749e12bba Jest matchers can accept many arguments 2017-11-09 22:24:44 +00:00
Andy 19f89399e4 Ensure every package has a tslint.json (#21009)
* Ensure every package has a tslint.json

* Fixes
2017-10-25 11:13:50 -07:00
Andy 097d2acf71 Miscellaneous lint fixes (#20849) 2017-10-22 15:22:50 -07:00
totano 135425f6da @types/jest: added setTimeout method (#20610)
* added setTimeout method

* Update and rename index.d.ts to test

* Rename test to index.ts

* Update index.ts

* Rename index.ts to index.d.ts

* Update index.d.ts

* Update jest-tests.ts

* Update jest-tests.ts

* Update jest-tests.ts

* Update jest-tests.ts
2017-10-17 10:13:28 -07:00
jwbay 265c894983 [jest] use default type params for mock and spy declarations (#20577) 2017-10-16 14:45:16 -07:00
Andy 947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Waseem Dahman 36c50d8150 Added type definition for expect.stringContaining (#20171) 2017-10-02 10:32:27 -07:00
Daniel Bradley e60ae2a05c Fix parameter name of toBeCloseTo (#19826)
The second argument passed in is not the amount that the number should be within, but is actually the number of significant digits to check. 

Reference: https://github.com/facebook/jest/blob/master/docs/en/ExpectAPI.md#tobeclosetonumber-numdigits
2017-09-25 16:50:09 -07:00
firsttris d061c94a0d bump jest version to 21.1 2017-09-21 06:51:30 +02:00
firsttris 02323b5357 jest: added restoreAllMocks 2017-09-20 19:49:04 +02:00
firsttris 6c121d8c2f jest: added restoreAllMocks 2017-09-20 19:45:34 +02:00
Andy d74806eb3d Add lint disables for no-unnecessary-generics (#19508) 2017-09-01 08:34:37 -07:00
Silvio Ginter b641de08ea [@types/jest] Fix tsc rejects constructor arguments for Mock<T>, as it works like intended (#19268)
* Fix tsc rejects constructor arguments for Mock<T>, as it works like intended

* apply code format
2017-08-23 07:33:19 -07:00
Andy 924fafffc0 Fix remaining lint errors (#19166) 2017-08-20 15:37:53 -07:00
Andy 5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07:00
Ika 00e167da06 fix(jest): add missing arguments for jest.doMock() (#18830) 2017-08-14 11:14:15 -07:00
Neil Gentleman 23ebc3e63e [jest] add timeout parameter to lifecycle methods (#18556) 2017-08-02 13:04:06 -07:00