Skip to content

Instantly share code, notes, and snippets.

@epreston
Created April 28, 2023 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epreston/48bf4dae6bf0f0e655788c7301d017de to your computer and use it in GitHub Desktop.
Save epreston/48bf4dae6bf0f0e655788c7301d017de to your computer and use it in GitHub Desktop.
vitest - example setup file
// 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');
@epreston
Copy link
Author

Vue uses this file to extend expect with methods to test deprecation messages

https://github.com/vuejs/core/blob/main/scripts/setupVitest.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment