Tom Mrazauskas

Results 279 comments of Tom Mrazauskas

Here is the solution for multiple packages (adapted from [Jest docs](https://jestjs.io/docs/tutorial-react-native#transformignorepatterns-customization)): ```js transformIgnorePatterns: [ 'node_modules/(?!(@nuxtjs/svg-sprite|nuxt-i18n)/)' ] ```

`@vue/test-utils` uses Jest’s browser-like environment, but `@nuxt/test-utils` requires node-like environment to run tests. By adding the preset to `jest.config` you have set [`testEnvironment`](https://jestjs.io/docs/configuration#testenvironment-string) options to `'node'` instead of default `'jsdom'`....

@arishojaei Could you provide mode details (with code example) of what you are trying to test? Nuxt plugins can be tricky to test if they include conditionally rendered templates. Is...

@arishojaei If a plugin is just plain JavaScript, it is very easy to unit test it: ```ts import { Context } from '@nuxt/types' import { NuxtAxiosInstance } from '@nuxtjs/axios' import...

@mercs600 Please open separate issue (it helps other users to find solutions easier). And please add minimal reproduction.

Did you try playing with [`useFakeTimers` options](https://jestjs.io/docs/jest-object#jestusefaketimersfaketimersconfig)? Depending on situation something like `advanceTimers: true`, or `doNotFake: ['nextTick']` could make all work.

The API has changed since Jest 28. See Upgrade Guide: https://jestjs.io/docs/28.x/upgrading-to-jest28#fake-timers

Yep. Just as documented here: https://jestjs.io/docs/timer-mocks

Thanks for repo. Easy to fix. Change your test file like this: ```diff import { jest } from "@jest/globals"; - import { BrowserWindow } from "electron"; - import { exportedForTests...