Commit Graph
53 Commits
Author SHA1 Message Date
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
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
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
Andy af8b0d1294 FIx new lint errors (#18382) 2017-07-25 10:34:23 -07:00
Ika 2b52c98aea feat(jest): add types for implementing custom interfaces (#18034)
* refactor(jest): enable tslint

* feat(jest): use global-modifying-module format

* feat(jest): add types for implementing custom interfaces

* fix(jest): should use interface instead of class, since it does not exist in jest environment

* docs(jest): fix typo

* revert: feat(jest): use global-modifying-module format

This reverts commit 99f7db4eac4530423f9de99f0553dbbc5043fc1d.

* docs(jest): fix typo

* feat(jest): update TS version to 2.2

* fix(jest): flow's Maybe type
2017-07-17 11:12:12 -07:00
Dan Dascalescu 114f6f2787 toMatchObject can also match arrays
https://github.com/facebook/jest/pull/3994
2017-07-08 15:42:07 -07:00
Allan Lukwago 8fe04c5e3c [Jest] @param for timeout 2017-06-21 07:55:44 +03:00
Allan Lukwago ce62b6f1ba [Jest] add timeout option to It interface 2017-06-18 12:14:17 +03:00
slavasitnikov 6d1aa9f59f Merge branch 'master' into jest-toBeNaN 2017-06-16 11:59:18 +03:00
Mine Starks d3d1cb1d0a Merge pull request #16645 from garbles/master
Add resolves and rejects to Jest Matchers interface
2017-06-15 15:57:16 -07:00
Andy 1ee9a51f35 Avoid unnecessary /// <reference types="node" /> in tests (#17226) 2017-06-15 14:53:16 -07:00
zorak c9366a2155 [jest] Bump version 2017-06-15 11:49:58 +03:00
zorak 8d17972c7b [jest] Add toBeNaN matcher 2017-06-15 11:33:09 +03:00
eug48 da66e73945 jest: added addSnapshotSerializer (#16334)
based on flow typings at https://github.com/facebook/jest/blob/e56103cf142d2e87542ddfb6bd892bcee262c0e6/types/PrettyFormat.js
2017-06-01 08:11:18 -07:00
Gabe Scholz 649f8e44f1 PR Fixes:
- Fix Jest version
- Add hasAssertions()
2017-05-29 16:17:51 -07:00
Gabe Scholz dd14b49658 Ensure that typings for resolves and rejects return type Matchers<Promise<void>> 2017-05-23 12:01:10 -07:00