|
| 1 | +## 0.3.0 (May 17, 2023) |
| 2 | + |
| 3 | +### Features |
| 4 | + |
| 5 | +- #### feat: added the total duration of all tests in the reported summary ([#35](https://github.com/react-gjs/gest/pull/35)) |
| 6 | + |
| 7 | + Report summary is now able to display one more additional information - the time it took to complete all the tests. |
| 8 | + |
| 9 | +- #### feat: function mocks ([#34](https://github.com/react-gjs/gest/pull/34)) |
| 10 | + |
| 11 | + Added a Function Mock API, that allows to create special functions which are being tracked and can have their implementation changed at any time. |
| 12 | + |
| 13 | + Mocks track information's about: |
| 14 | + - the amount of times they were called |
| 15 | + - arguments provided to each call |
| 16 | + - result given for each call |
| 17 | + - whether a call ended in a failure or not |
| 18 | + - whether the returned value was a Promise or not |
| 19 | + - number of mock calls that are still pending (unresolved promises) |
| 20 | + |
| 21 | +- #### feat: added FakeTimers feature ([#33](https://github.com/react-gjs/gest/pull/33)) |
| 22 | + |
| 23 | + Added fake timers. To use fake timers use the global variable that globally available in all tests - `FakeTimers`. |
| 24 | + |
| 25 | + **Example** |
| 26 | + |
| 27 | + ```ts |
| 28 | + export default describe("FakeTimers test", () => { |
| 29 | + it("timers are disabled in this test", () => { |
| 30 | + FakeTimers.enable(); |
| 31 | + |
| 32 | + let wasCalled = false; |
| 33 | + |
| 34 | + const onTimeout = () => { |
| 35 | + wasCalled = true; |
| 36 | + } |
| 37 | + setTimeout(onTimeout); // will never run until manually triggered |
| 38 | + |
| 39 | + wasCalled; // false |
| 40 | + |
| 41 | + FakeTimers.runNext(); // trigger, will invoke the `onTimeout` callback |
| 42 | + |
| 43 | + wasCalled; // true |
| 44 | + |
| 45 | + FakeTimers.disable(); // remember to disable fake timers once the test ends |
| 46 | + }) |
| 47 | + }) |
| 48 | + ``` |
| 49 | + |
| 50 | +- #### feat: reworked the stack parsing algorithm, added config option that allows for replacing this algorithm ([#32](https://github.com/react-gjs/gest/pull/32)) |
| 51 | + |
1 | 52 | ## 0.2.0 (May 3, 2023) |
2 | 53 |
|
3 | 54 | ### Features |
|
8 | 59 |
|
9 | 60 | Additionally `beforeEach` and `afterEach` hooks will now always be skipped along with the individual tests. Before those hooks could be ran before a test that was skipped. |
10 | 61 |
|
11 | | -- #### feat: added timouts to test units ([#27](https://github.com/react-gjs/gest/pull/27)) |
| 62 | +- #### feat: added timeouts to test units ([#27](https://github.com/react-gjs/gest/pull/27)) |
12 | 63 |
|
13 | 64 | Added timeouts to all unit tests. Previously the config had a timeout threshold option, but it did not do anything. If a tests hanged and did never finish `gest` would also hang. A proper timeouts are now added, by default if a single test takes longer than 5 seconds it will be marked as failed. (this does not prevent synchronous thread locks, for example a synchronous infinite loop will still lock the program) |
14 | 65 |
|
|
0 commit comments