Skip to content

Global test context #6222

Answered by sheremet-va
canassa asked this question in Q&A
Discussion options

You must be logged in to vote
  1. It is not possible to extend the default test from vitest. I don't see how importing it is cumbersome, it takes the same amount of steps - I would recommend exporting a test function instead of myTest:
import { test as baseTest } from 'vitest'
export const test = baseTest.extend({
   // ...
})
  1. describe doesn't care about the context so you can just use it. it is an alias for test, they reference the same function, so it doesn't matter which one you use

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by canassa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants