Created
April 28, 2023 19:30
-
-
Save epreston/48bf4dae6bf0f0e655788c7301d017de to your computer and use it in GitHub Desktop.
vitest - example setup file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup.js - vitest | |
// This contains code that should be made available to every test and | |
// code that should be run before any mock or import in a test file. This | |
// file will execute just after the test file's environment has been loaded. | |
// if (typeof window === 'undefined') { | |
// global.window = {}; | |
// } | |
// window.__APP_DATA__ = { | |
// site: { | |
// locale: 'en', | |
// }, | |
// }; | |
// console.log('window.__APP_DATA__.site.locale'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue uses this file to extend
expect
with methods to test deprecation messageshttps://github.com/vuejs/core/blob/main/scripts/setupVitest.ts