chore(deps): update dependency vitest to v0.10.0 #1864

Merged
konrad merged 1 commits from renovate/vitest-0.x into main 2022-04-25 21:01:02 +00:00
Member

This PR contains the following updates:

Package Type Update Change
vitest devDependencies minor 0.9.4 -> 0.10.0

Release Notes

vitest-dev/vitest

v0.10.0

Compare Source

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


Configuration

📅 Schedule: 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 Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [vitest](https://github.com/vitest-dev/vitest) | devDependencies | minor | [`0.9.4` -> `0.10.0`](https://renovatebot.com/diffs/npm/vitest/0.9.4/0.10.0) | --- ### Release Notes <details> <summary>vitest-dev/vitest</summary> ### [`v0.10.0`](https://github.com/vitest-dev/vitest/releases/v0.10.0) [Compare Source](https://github.com/vitest-dev/vitest/compare/v0.9.4...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. ```diff - 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`). ```ts 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: - [`beforeAll`](https://vitest.dev/api/#beforeall) - [`beforeEach`](https://vitest.dev/api/#beforeeach) ##### Test Context Inspired by [Playwright Fixtures](https://playwright.dev/docs/test-fixtures), Vitest's test context allows you to define utils, states, and fixtures that can be used in your tests. ```ts 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](https://vitest.dev/guide/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 [#&#8203;551](https://github.com/vitest-dev/vitest/issues/551). Thanks to the newly introduced [Test Context](#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. ```ts 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 [@&#8203;ericjgagnon](https://github.com/ericjgagnon) ([#&#8203;1136](https://github.com/vitest-dev/vitest/issues/1136)) ([f2bceb2](https://github.com/vitest-dev/vitest/commit/f2bceb2)) #### Bug Fixes - types for EachFunction are missing awaitable return (fix: [#&#8203;1181](https://github.com/vitest-dev/vitest/issues/1181)) ([#&#8203;1182](https://github.com/vitest-dev/vitest/issues/1182)) ([95b1ba4](https://github.com/vitest-dev/vitest/commit/95b1ba4)) </details> --- ### Configuration 📅 **Schedule**: 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
renovate added the
dependencies
label 2022-04-25 15:02:33 +00:00
Member

Hi renovate!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://1864-renovate-vitest-0-x--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi renovate! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://1864-renovate-vitest-0-x--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
renovate force-pushed renovate/vitest-0.x from d9e5515de1 to 8fc10e434e 2022-04-25 17:02:46 +00:00 Compare
renovate force-pushed renovate/vitest-0.x from 8fc10e434e to 120df8d4b0 2022-04-25 19:02:58 +00:00 Compare
konrad merged commit f558441250 into main 2022-04-25 21:01:02 +00:00
konrad deleted branch renovate/vitest-0.x 2022-04-25 21:01:02 +00:00
Author
Member

Renovate Ignore Notification

As this PR has been closed unmerged, Renovate will now ignore this update (0.10.0). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the ignoreDeps array of your renovate config.

If this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.

### Renovate Ignore Notification As this PR has been closed unmerged, Renovate will now ignore this update (0.10.0). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the `ignoreDeps` array of your renovate config. If this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.
This repo is archived. You cannot comment on pull requests.
No description provided.