187 Commits

Author SHA1 Message Date
Vladimir
5c88d8e582
feat(vitest): allow calling skip dynamically (#3966) 2023-08-16 15:41:41 +02:00
Arthur Datsenko-Boos
5a07cffa55
docs: Fix sentence inside vi.md (#3897)
Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2023-08-15 17:48:59 +02:00
Vladimir Sheremet
dbf0e97953 docs: fix return type for vi.fn 2023-08-14 11:49:54 +02:00
Joris
b7ce1959bd
Import "describe" in sample code (#3801) 2023-07-25 12:24:45 +02:00
Han
8693449b41
feat: support describe.sequential (#3771)
Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2023-07-19 17:14:48 +02:00
Jacob Beck
2f2e80f703
docs: describe mock result behavior with promises (#3635) 2023-07-11 09:50:44 +02:00
Han
a749a6c01f
feat: support use function/class as bench name (#3711) 2023-07-03 09:59:47 +02:00
Han
1621cc6365
feat: support accessing other fixtures in fixture function (#3651) 2023-07-03 09:59:22 +02:00
renovate[bot]
c8c1b4a6a3
chore(deps): update all non-major dependencies (#3662)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-06-28 19:55:17 +02:00
Vladimir
47383eb78a
docs: specify Vitest version for test.extend (#3683) 2023-06-27 13:41:27 +02:00
Dunqing
6d146d1690
fix(runner): make the default value of retry and repeats 0 (#3638) 2023-06-22 16:02:08 +02:00
Han
2db1a737f1
feat(runner): support test.extend (#3554) 2023-06-19 10:19:39 +02:00
Han
8e385bb09e
feat(expect): support expect.unreachable (#3556)
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
2023-06-16 11:53:49 +02:00
Dunqing
dff19bc268
docs: update expect.soft related documentation (#3535)
Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
2023-06-15 10:23:21 +02:00
Han Feng
15253890e6
feat(runner): support using function/class as describe/test name (#3497) 2023-06-05 14:26:15 +02:00
Alessandro Di Dio
b3602bcc4d
feat(dev): add moduleDirectories option to the vitest config (#3337)
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-05-30 10:13:10 +02:00
Vladimir Sheremet
fde628ad3d chore(docs): fix vi.mock example 2023-05-09 15:49:35 +02:00
Lyx
77d071a91f
docs(expect): correct code block mistake (#3304) 2023-05-05 07:05:44 +02:00
renovate[bot]
48c4e8c68b
chore(deps): update all non-major dependencies (#3238)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-05-04 08:18:01 +02:00
Vladimir
cf3afe2bea
feat!: move assertion declarations to expect package (#3294) 2023-05-03 18:25:38 +02:00
Vladimir
0c09a40d2b
feat!: update mock implementation to support ESM runtime, introduce "vi.hoisted" (#3258) 2023-04-27 15:04:05 +02:00
samkevin1
7c8f0ba989
feat: add repeat method to tests (#2652) 2023-04-15 13:00:45 +02:00
Ben Hong
aa22f7979e
docs: improve spyOn example with a contextual example (#3185) 2023-04-12 20:18:16 +02:00
Vladimir
b9d1a97599
feat!: add workspace support (#3103) 2023-04-09 15:12:26 +02:00
renovate[bot]
0f86ff9897
chore(deps): update all non-major dependencies (#2766)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-04-06 16:53:03 +02:00
btea
c51433d074
docs: add chaiConfig note (#3144)
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-04-06 15:52:09 +02:00
Vladimir Sheremet
7347179aa4 docs: add Vitest version to toMatchFileSnapshot documentation 2023-04-05 21:23:04 +02:00
Vladimir
313032cdf9
fix: move "mergeConfig" into "vitest/config" and add extension to imports in the documentation (#3139) 2023-04-05 18:39:24 +02:00
Samuel Bodin
74b7ab005a
docs: update extend matcher (#3123)
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-04-05 18:38:04 +02:00
Mohammad Bagher Abiat
affc6d82d6
docs: add the motivation section for more context (#3104)
Co-authored-by: Christian Bromann <git@bromann.dev>
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-04-05 10:05:02 +02:00
Anthony Fu
bdc06dcbc4
feat(snapshot): introduce toMatchFileSnapshot and auto queuing expect promise (#3116) 2023-04-03 16:03:46 +02:00
Vladimir
2f1dc5ced3
feat!: remove tinyspy internal properties on Vitest spies (#3069) 2023-03-29 14:14:48 +02:00
jonathan-graf
09fec8464b
docs: elaboration for resetModules (#3059)
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
2023-03-27 12:11:39 +02:00
Ólafur Waage
96da6c10ef
docs: very minor grammar changes in expect.md (#3068) 2023-03-23 15:16:55 +01:00
Obada Khalili
610b1d46da
feat(spy): implement mock.withImplementation API (#2835)
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
2023-02-24 20:23:20 +01:00
Wenzhe Wang
65d71b9e97
fix: cleanup last mocked cache when call vi.doMock (#2872)
fix https://github.com/vitest-dev/vitest/issues/2870
2023-02-22 12:52:43 +01:00
Tom Thumb
b67a5fbdf9
docs: update snapshot section to provide details on how to use with concurrent test (#2733)
Co-authored-by: Tom Thumb <github@asdfjkalsdfla.com>
Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2023-02-14 18:05:21 +01:00
Trivikram Kamat
8705e6b275
fix(expect): accept array index as number in toHaveProperty (#2808)
* test(expect): add toHaveProperty array index string

* test(expect): add toHaveProperty array index number

* fix: coerce key to string primitive in expect.toHaveProperty

* fix: accept string or number array in toHaveProperty property

* test: remove ts-expect-error from toHaveProperty test for array index number

* test: expect.toHaveProperty with object key '0'

* fix: snapshot for complex object in jest-expect.test.ts

* docs: expect.toHaveProperty deep referencing using an array containing the keyPath
2023-02-11 15:13:52 +01:00
Cue
9a0002be7c
docs: fix broken links (#2739) 2023-02-11 13:47:57 +01:00
Tan Li Hau
445c7b3569
docs: fix broken links to vi (#2832) 2023-02-08 11:48:36 +01:00
Lioness100
2f87505ffd
docs: fix typos (#2815) 2023-02-08 11:30:35 +01:00
Arek Tywonek
439c24365b
docs: typo (#2757) 2023-01-27 14:12:26 +01:00
Vladimir
8b50123014
docs: split API into separate pages (#2635)
* docs: split API into separate pages

* Apply suggestions from code review

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2023-01-16 15:54:03 +01:00
guillaumeduboc
40187bdbbd
feat: add runAllTimersAsync from sinonjs (#2209)
close https://github.com/vitest-dev/vitest/issues/1804
2023-01-16 09:21:43 +01:00
Tomas Chmelevskij
6145d7bf0d
docs: typo (#2663) 2023-01-14 11:30:07 +01:00
Robbe Claessens
2daf44af2e
docs: add describe.skipIf documentation (#2558)
* add describe.skipIf documentation

* Update index.md

* Apply suggestions from code review

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>

Co-authored-by: Robbe <robbe@dexxter.be>
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2023-01-12 10:17:08 +01:00
Drew Powers
532cc11b0c
docs: add info to toThrowError (#2447)
#2262
2023-01-09 22:18:53 +01:00
Vladimir
ce5b4b85b7
docs: update API mocking documentation (#2553)
* docs: update API mocking documentation

* Apply suggestions from code review

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>

* chore: more docs

* chore: cleanup

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
2022-12-22 16:35:15 +03:00
Anthony Fu
853eeddba8
feat(mock): expose a importOriginal helper to the factory (#2551) 2022-12-22 14:26:05 +01:00
Vladimir Sheremet
881bd7a3d6 chore: add version to "stubEnv" and "unstubAll" 2022-12-16 17:59:44 +01:00