Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

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

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 24, 2022

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
vitest ^0.9.4 -> 0.10.0 age adoption passing confidence

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 WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/vitest-0.x branch from 4a4d597 to fdced47 Compare April 24, 2022 17:01
@github-actions
Copy link

github-actions bot commented Apr 24, 2022

size-limit report 📦

Path Size
./dist/react-vite-storybook-typescript-starter.es.js 10.05 KB (0%)
./dist/react-vite-storybook-typescript-starter.umd.js 10.39 KB (0%)

@renovate renovate bot changed the title chore(deps): update dependency vitest to v0.9.4 chore(deps): update dependency vitest to v0.9.4 - autoclosed Apr 24, 2022
@renovate renovate bot closed this Apr 24, 2022
@renovate renovate bot deleted the renovate/vitest-0.x branch April 24, 2022 17:44
@renovate renovate bot changed the title chore(deps): update dependency vitest to v0.9.4 - autoclosed chore(deps): update dependency vitest to v0.9.4 Apr 25, 2022
@renovate renovate bot restored the renovate/vitest-0.x branch April 25, 2022 17:28
@renovate renovate bot reopened this Apr 25, 2022
@renovate renovate bot changed the title chore(deps): update dependency vitest to v0.9.4 chore(deps): update dependency vitest to v0.10.0 Apr 25, 2022
@renovate renovate bot force-pushed the renovate/vitest-0.x branch from fdced47 to 0779508 Compare April 25, 2022 17:28
@openscript openscript merged commit 9569d54 into main Apr 25, 2022
@renovate renovate bot deleted the renovate/vitest-0.x branch April 25, 2022 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants