chore(deps): update dependency vitest to v0.15.2
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| vitest | 0.2.5 -> 0.15.2 |
Release Notes
vitest-dev/vitest
v0.15.2
Β Β Β π Bug Fixes
- Allow redefining global expect, closes
#1496 - Calculate label of graph node
#1431 - Snapshots are now updating
#1503 - Return types for vi.mocked are now equal to MaybeMocked
#1511 - Don't mark skipped snapshots as obsolete
#1505 - Correctly generate inline snapshots inside js files
#1510 - Respect transformMode when resolving id
#1506
Β Β Β β€οΈ Contributors
Β Β Β Thanks to @βantfu | @βnieyuyao | @βRedJanvier | @βrenovate[bot] | @βsheremet-va
Β Β Β Β View changes on GitHub
v0.15.1
Β Β Β π Bug Fixes
- Reliably process css with
cssoption22fed1b8
Β Β Β β€οΈ Contributors
Β Β Β Thanks to @βsheremet-va | @βstormwarning
Β Β Β Β View changes on GitHub
v0.15.0
Β Β Β π Features
- Bind expect state to context
#1468 - Introduce
VITEST_POOL_ID#1473 - Add
maxConcurrencyoption,5by default#1483 - Add --shard command
#1477 - Add
cssconfig option, don't process CSS by default#1467
Β Β Β π Bug Fixes
- Null inside test.each is not turned into an empty array
#1462 - Add @βtypes/node to dependencies
#1474 - Parent is defined on global, closes
#1489 -
web-worker:
- Ensure event listener functions are bound correctly
#1487
- Ensure event listener functions are bound correctly
Β Β Β Β View changes on GitHub
v0.14.2
Bug Fixes
- can mock files with space in path (#β1457) (235b950)
- skip writing snap file, if content didn't change (#β1456) (97106f6)
- ui: update vue dependency conflict (#β1460) (9a87a3c)
- allow accessing Audio, Option and private jsdom props on global (#β1443) (95ded47)
- build failing with Vite 3 (#β1451) (60eaee0)
- don't fail when there is no source file defined in source map (#β1453) (03c7cf6)
- resolve circular ref when cloning object (#β1444) (8452a7d)
Features
- improve deep equality check failing message for toBe (#β1383) (842e048)
- new
--ouputDiffLinescli flag (#β1446) (0b8a5bc)
v0.14.1
Bug Fixes
v0.14.0
Breaking Changes
-
vite-node: use
.mjsfor esm build (692ad34) - remove
"type": "module"from vitest/package.json (#β1411) (b4a9b0b), closes #β325 - vite-node: respect ssr field, allow inlining everything (#β1434) (fd57b0e)
- improve watcher performance, add forceRerunTriggers option,
watchIgnoreis renamed towatchExcludeand now accepts only glob patterns (#β1424) (3f5ff5b)
Bug Fixes
- repair TestFunction return type. (#β1408) (f169f5a)
- don't escape quotes for objects in difference view (#β1435) (1560417)
- types: add callable type to vi.spyOn (#β1432) (17dfd39)
- types: add explicit extension for ESM compatibility (#β1417) (4b54aed)
- vite-node: Prevent crash when passing single module as options (#β1406) (ab8f004)
v0.13.1
Bug Fixes
- don't escape $ in snapshots, when not needed (#β1401) (c5b7a72)
- don't generate coverage folder when coverage is not enabled (#β1403) (6c424de)
- update esbuild to fix UI crash (#β1404) (b122691)
Features
v0.13.0
Features
v0.12.10
Bug Fixes
- birpc using safe timers (#β1379) (89353ae)
- improve test name escaping in TAP reporters (#β1367) (f8db7d7)
Features
- add dynamicImportSettled utility function (#β1359) (1793937)
- Export snapshot state to
expect.extend. (#β1378) (4ec0a76)
v0.12.9
Bug Fixes
- handle error from pool.run (#β1348) (fbaa546)
- toSatisfy never executes the matcher function (#β1350) (5654a88)
- config: add local file fallback for setup files (#β1347) (478465a)
v0.12.8
Bug Fixes
- don't bind global classes (#β1345) (195cc58)
- replace root when resolving dependency (#β1310) (b802d5e)
v0.12.7
Bug Fixes
- don't crach on DOMError (#β1341) (527bb37)
- simplify globals access, fix global != global (#β1340) (d32a758)
- test:ci: reporters utils test is failing (#β1308) (775a26d)
- vite-node: fix cb func argument for change event (#β1319) (b228edb)
- ws-client: should use costom WebSocketConstructor (#β1313) (03a54e0)
Features
- add function/promise forms of defineConfig() (#β1324) (5af545d)
- support npm setup files (#β1312) (7b56822)
v0.12.6
Bug Fixes
-
.resolvesand.rejectsexpectations (#β1300) (789cc93) -
process.stdoutcould be undefined on Windows (fix #β1292) (#β1305) (3179ac9) - can mock non-existent paths and virtual modules via mocks (#β1298) (c491fb4)
v0.12.5
Bug Fixes
Features
-
vite-node: include
debug(ed3374f)
v0.12.4
Bug Fixes
- snapshot: only add indent when the line is not empty (6a5dfe8)
Features
-
onConsoleLogoptions to filter logs (35c1b52) - press
fto rerun only failed tests (#β1283) (3c6f991)
v0.12.3
Bug Fixes
- try disable atomics for workers (154db71)
v0.12.2
Bug Fixes
Features
- support custom env in config (4701e0b)
v0.12.1
Bug Fixes
- fix
requirereference (5da8b00) - console: ignore empty stdout/stderr (d3fb532)
- clear mock from callstack, if mocked with factory (#β1276) (7459ff8)
- don't show __vite_ssr prefix on imported variables (#β1272) (a2f17b0)
Features
v0.12.0
Bug Fixes
Features
- allow passing passWithNoTests, allowOnly inside config (#β1264) (dd3c5a1)
- initialize environment only once for no-threads (#β1263) (2d3f8d5)
v0.11.0
Bug Fixes
- add animation frame methods to global (#β1258) (34e177f), closes #β1243
- add missing c8 option
src(#β1254) (b7973fe) - close node.js server correctly in the puppeteer example (#β1257) (98e57e2)
- resolve id before loading from vite (#β1204) (110788a)
Features
- self/window/global share state with globalThis (#β1256) (fbd7974)
- vite-node: replace minimist with cac (#β1249) (d9ad044)
v0.10.5
Bug Fixes
Features
v0.10.4
Bug Fixes
v0.10.3
Bug Fixes
- default to faled tests and unchecked snapshots when updating snapshots (#β1238) (3d8e846)
- show custom error message if snapshot failed (#β1237) (a955655)
- use console._stdout, if available (#β1235) (d15d47f)
- inline-snapshots: detect linebreaks (#β1232) (4de5da7)
v0.10.2
Features
v0.10.1
Bug Fixes
- clear errors before running files (#β1205) (ac9645c)
- diff output is incorrectly when using expect.any (#β1197) (d09de8f)
- self exported module call stack error (#β1221) (4956713)
- todo assertion status in json output (#β1223) (a944a91)
- typo in feature request template (#β1222) (adb49fd)
- types: autocomplete built-in reporters (#β1189) (750c80b)
Features
v0.10.0
Breaking Changes
From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use async/await functions, or use Promise to mimic the callback style.
- it('should work', (done) => {
+ it('should work', () => new Promise(done => {
// ...
done()
- })
+ }))
Features
beforeAll / beforeEach cleanup callback
beforeAll / beforeEach now accepts an optional cleanup function as the return value (equivalent to afterAll / afterEach).
import { beforeAll } from 'vitest'
beforeEach(async () => {
// called once before each test run
await startMocking()
// clean up function, called once after each test run
return async () => {
await stopMocking()
}
})
Learn more at:
Test Context
Inspired by Playwright Fixtures, Vitest's test context allows you to define utils, states, and fixtures that can be used in your tests.
import { beforeEach, it } from 'vitest'
beforeEach((context) => {
// extend context
context.foo = 'bar'
})
it('should work', ({ foo }) => {
console.log(foo) // 'bar'
})
Learn more at Test Context
Concurrent Snapshot
Due to the limitation of JavaScript, timing based Singleton pattern will cause conflicts when running multiple async functions in concurrent. Previously reported as #β551. Thanks to the newly introduced Test Context, we can now provide a test specific expect instance to avoid conflicts. To use it, you can destructure the expect from each test context instead of the global one.
test.concurrent('test 1', async ({ expect }) => {
expect(foo).toMatchSnapshot()
})
test.concurrent('test 2', async ({ expect }) => {
expect(foo).toMatchSnapshot()
})
Reporter from file / package
Now you can pass a path to file, or a package name to the reporters options to use custom reporter. Thanks to @βericjgagnon (#β1136) (f2bceb2)
Bug Fixes
v0.9.4
Bug Fixes
- deps: update all non-major dependencies (#β1159) (4d1e0a0)
- config.root priority (#β1164) (d8e0493)
- optimizeDeps.disabled (#β1150) (b40fb60)
- remove invalid xml characters in junit reporter output (fix #β1144) (#β1145) (ab8e2b8)
- remove process.env edge case in defines (#β1156) (0c9137d)
- reset snapshot state between test reruns (#β1162) (c2e98ef)
- temporary revert @βsinonjs/fake-timers (f685b87)
Features
- ui: add the draft state * on code editor (#β1131) (571b94b)
- add satisfy alias (#β1172) (7dbd837)
v0.9.3
Bug Fixes
- add
vite-nodeto rootdevscript (#β1129) (5f53680) - always show filters, when no tests found (#β1124) (ce53037)
- Issue Template docs link (#β1128) (03aff85)
- respect
clearScreenoption in vite, close #β1125 (d482992)
v0.9.2
v0.9.1
Bug Fixes
-
displayDiffwith non-string (61fbddb) - make automocking aware of symbol indexed methods (#β1119) (06faf8a)
- re-export mock types (#β1120) (45ef020)
Features
- ui: fix file error + add colored support (#β1108) (b737476)
- extend
config.outputFileto allow objects, close #β1068 (#β1073) (a63cfa2)
v0.9.0
Bug Fixes
Features
v0.8.5
Bug Fixes
- mock-api: provide an explainatory error message when the mocks API hoisting doesn't work (#β1098) (0b6d980)
- don't reexport vi utils from vitest (#β1100) (6f55275)
- exported configDefaults has right type (#β1117) (1696195)
- fix duration when fake timers are enabled (#β1089) (bec43fc)
- get taskId before scheduling console (#β1086) (cb90dcb)
- hide ignored stacktrace on windows (#β1116) (57c048b)
- really disable deps optimization (#β1104) (0d2413f)
- rerun tests on --changed, if test was changed (#β1115) (6473fd4)
- logs: collect logs per test (#β1088) (b24fb25)
- ui: a11y + codemirror scrolls + minor addons (#β1103) (a1188b5)
- ui: hide native codemirror scrolls on firefox (#β1105) (cf226c5)
- typescript allows new Spy, add lastCall support for spy (#β1085) (6680152)
Features
- add resolveSnapshotPath option (#β1101) (5cc592b)
- show all spy calls on assertion error (#β1091) (b027d16)
v0.8.4
Bug Fixes
Features
- add commands to run tests depending on changed files (#β1078) (3c965d4)
- reprint all tests, if one of the test files was deleted (#β1081) (2ded624)
v0.8.3
Bug Fixes
Features
- show more details when no test files found (#β1033) (190b1c1)
- stubGlobals helper (#β1079) (1582948)
v0.8.2
Bug Fixes
- inconsistency with globTestFiles and isTargetFile (fix #β981, #β982) (#β1070) (64f302d)
- vitest run do not normalize paths on windows x64 platforms (#β1064) (87542f8)
v0.8.1
Bug Fixes
- downgrade engine requirement (2d84a1e)
v0.8.0
Bug Fixes
- align json output with jest's (#β1034) (3326332)
- remove depercated
globaloption in favor ofglobals(#β970) (2d662ec) - web-worker: deps externality (b5d97b0)
Features
- vite-node: support debug flag to emit additional info (6dd7f53)
v0.7.13
Bug Fixes
v0.7.12
Bug Fixes
Features
- ui: allow case insensitive search & optmize search (#β1035) (c6dd63a)
- add parameter for test name of each (#β1031) (4210c39)
v0.7.11
Bug Fixes
- assertions error message (#β1027) (f52cd93)
- don't use global timers (#β1026) (16d65a7)
- inlining vitest in cnpm (#β1015) (f1b247f)
v0.7.10
Bug Fixes
- relax engine requirements (7719bb0)
v0.7.9
Bug Fixes
v0.7.8
Bug Fixes
v0.7.7
Bug Fixes
- prevent crashing when directory of
outputFiledoes not exist (#β986) (5eac4ca) - render original source if mapped in node (#β987) (42406a3)
Features
- adding ui component tests (#β590) (7952647)
- ui: open in IDE tests with error on report and code tabs (#β992) (c977c33)
v0.7.6
Bug Fixes
- vite-node: fix externalizing (6f265e0)
v0.7.5
Features
v0.7.4
Bug Fixes
v0.7.3
Bug Fixes
-
process.env.VITEST_MODEtiming (2254c91)
v0.7.2
Features
- expose
process.env.VITEST_MODE(6647fa7) - new
getRunningModeutils (3d6c41a) - new
isFirstRunutils (210bc6f)
v0.7.1
Bug Fixes
- inline
mockdateand fix negative thread time (#β972) (aa239bf) - mock: reset mock state before each run (0e9b92d)
- reporter: hooks status alignment (713c456)
Features
v0.7.0
Breacking changes
- vite-node: don't fallback to cjs by default (#β924) (d959f28)
- vite-node: normalize relative paths to be from current working directory (#β952) (7b98344)
-
vite-node: rework
moduleCache, fix hmr (#β961) (f26cdf2)
Features
v0.6.3
Bug Fixes
- add Module symbol to export object (#β951) (1c6ffca)
-
vite-node: make
resolveIdoptional (aba4ea8) - file filters on windows (fix #β693) (#β955) (1973bea)
- update inlineSnapshot should not remove end whitespace, close #β922 (#β956) (a8955bb)
- cli: dir options type (e50ca95)
- expect: toHaveProperty support array syntax like jest (fix #β937) (#β938) (e3a7ff3)
Features
- add optional generic on array containing (#β935) (6ca857b)
- group sync console.log calls with macro task (51c2058)
v0.6.1
Bug Fixes
- dont'call fn twice in toThrow (#β915) (c472614)
- export Window interface in jsdom environment (#β925) (1a2dfd8)
- json reporter detects
skipmode correctly (#β930) (5993ce1) - resolve dynamicly imported modules to be the same as statically (#β911) (094d23e)
Features
- add perfStats to json reporter (#β933) (89c8421)
- added nextjs example (#β920) (2e8a3b1)
- create asymmetric matchers when extending expect (#β934) (086a77c)
v0.6.0
Bug Fixes
Features
- loading animation for
beforeEach,beforeAll,afterEach,afterAll(#β898) (95d6432) - support in-source tests via
import.meta.vitest(#β901) (3eec387)
v0.5.9
Bug Fixes
- handle error during global setup (#β875) (21eef05)
- passing non array to reporters option did not effect (#β878) (cb5994b)
- unhandled error handler (#β876) (1fcb4ed)
v0.5.8
Bug Fixes
v0.5.7
Bug Fixes
- do not override syntax error (7876bff)
v0.5.6
Bug Fixes
- correctly remove import query from url (#β854) (38c5c8d)
- ui: search error (fix #β848) (#β849) (cc76167)
- svelte wasn't included in code coverage by default (#β851) (41025cb)
Features
-
cli:
--diroption (70cac6c)
v0.5.5
Bug Fixes
- error out on empty test files (325ea1e)
v0.5.4
Bug Fixes
- add a suggestion to the error message of timeout (#β837) (2707513)
- fix process exit timing (4c9dbd0)
- improve types of test.each (#β840) (c161a44)
- testNamePattern matches against full name (fix #β838) (#β839) (e753493)
Features
- pretty display unhandled rejection (518e3dd)
v0.5.3
v0.5.2
Bug Fixes
- dev mode resolve (66551f8)
Features
v0.5.1
Bug Fixes
Features
v0.5.0
Breaking Change
-
defineConfigmoved fromvitest/nodetovitest/config, #β799
Bug Fixes
- config: ui and api regression (#β820) (e8468d2)
- global Event should be equal to env Event (#β793) (6ca343a)
- process "data:" in import correctly (#β823) (600ca80)
Features
v0.4.3
Bug Fixes
- add check to avoid converting 0 to undefined (#β802) (2e1e9c3)
- change return type of expect.any(...) to any (#β815) (311943f)
- resolve import path for dynamic imports (#β817) (e37f4de)
v0.4.2
Bug Fixes
- allow reassigning global mocks (#β792) (7b34793)
- vite-node: build spliting chunks (b04dd8f)
-
vite-node: external
/dist/by default (bb77e4f)
v0.4.1
Bug Fixes
- allow running --ui (#β787) (924ba44)
- don't remove user defines (#β790) (e2d2fac)
- remove ?import from query, so .[ext]$ checks will pass (#β786) (8213446)
v0.4.0
Bug Fixes
- fix error if toMatchInlineSnapshot is called on resolves/rejects (#β773) (6d19bf7)
- flush coverage after every test file (fix #β771) (#β776) (7611178)
- put envs from .env files on process.env (#β770) (1623b3c)
- set mode before running Vite (#β775) (c98355a)
Features
- add VITEST_WORKER_ID env (#β774) (b656f8d)
- allow reassigning
defineglobals (#β769) (15ea3a3) - coverage threshold (#β783) (b068b44)
v0.3.6
Bug Fixes
Features
Performance Improvements
v0.3.5
Bug Fixes
-
describeasync support (#β750) (d4415fe), closes #β746 - add missing
defineConfighelper (#β749) (e72b881) - issue a warning in conflicting envs (#β744) (7448e1a)
- remove
describeasync support (#β746) (f9b52c1) - support for define global constants (#β743) (af9ceab)
Features
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by Mend Renovate. View repository job log here.