I’m creating a template to work with Quasar Framework, Vue 3, and Vite where the goal is to clone the project and develop the frontend without extensive configurations since everything should already be set up. So far, I’ve made decent progress. However, recently I implemented a security module (I know, better safe than sorry). When I tried running the tests, I encountered the following error:

I’ve researched this issue, but nothing seems to work.
Here is my package.json:
{
"name": "quasar-template",
"private": true,
"version": "1.6.4",
"type": "module",
"main": "index.html",
"description": "This is a template for quickly working with Quasar and Vite - Vue 3. It includes features that assist in both individual and group workflows, such as Husky for Git hooks, Prettier for code formatting, and ESLint for code quality checks. Additionally, it provides testing capabilities with Jest, along with Axios for HTTP requests, Crypto-js for cryptography functionalities, and Jwt-decode for JWT decoding. It also integrates Pinia for state management and Vue-router for routing. The template utilizes Sass for styling and supports TypeScript. Furthermore, it implements lint-staged for staged linting, and vue-eslint-parser for parsing Vue files within ESLint. Notably, it supports internationalization throughout the app, facilitating efficient adaptation of content and user interface to different languages via tools like vue-i18n, thus extending the application's reach to a broader audience.",
"keywords": [
"Quasar",
"Vite",
"Vue 3",
"Husky",
"Prettier",
"ESLint",
"Jest",
"Axios",
"Crypto-js",
"Jwt-decode",
"Pinia",
"Vue-router",
"Babel",
"Testing-library",
"Sass",
"TypeScript",
"lint-staged",
"vue-eslint-parser"
],
"repository": {
"type": "git",
"url": "https://github.com/Santiago1010/quasar-template.git"
},
"bugs": {
"url": "https://github.com/Santiago1010/quasar-template/issues"
},
"author": {
"name": "Santiago Correa Aguirre",
"email": "[email protected]"
},
"license": "MIT",
"scripts": {
"build": "vite build",
"dev": "vite",
"format": "prettier --write .",
"format:check": "prettier --check "{public,src}/**/*.{js,ts,vue,json,css}"",
"format:write": "prettier --write "{public,src}/**/*.{js,ts,vue,json,css}"",
"lint": "eslint .",
"lint:check": "eslint "{public,src}/**/*.{js,ts,vue,json}"",
"lint:fix": "eslint "{public,src}/**/*.{js,ts,vue,json}" --fix",
"prepare": "husky || true",
"preview": "vite preview",
"test": "jest",
"test:integrations": "jest ./src/testing/integration",
"test:unit": "jest ./src/testing/unit"
},
"lint-staged": {
"**/*.{js,ts,vue}": [
"prettier --write --ignore-unknown",
"eslint --fix",
"git add"
]
},
"dependencies": {
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@quasar/extras": "^1.16.9",
"axios": "^1.6.8",
"crypto-js": "^4.2.0",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
"pinia": "^2.1.7",
"quasar": "^2.14.5",
"vue": "^3.3.11",
"vue-i18n": "^9.9.0",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/preset-env": "^7.24.4",
"@quasar/vite-plugin": "^1.6.0",
"@testing-library/vue": "^8.0.2",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/test-utils": "^2.4.5",
"@vue/vue3-jest": "^29.2.6",
"babel-jest": "^29.7.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.23.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.33.0",
"ts-jest": "^29.1.2",
"vite": "^5.0.8",
"vite-plugin-environment": "^1.1.3",
"vue-eslint-parser": "^9.4.2"
}
}
This is my ./jest.config.json:
{
"transform": {
"^.+\.vue$": "@vue/vue3-jest",
"^.+\.js$": "babel-jest"
},
"testRegex": "(/__tests__/.*|(\.|/)(test|spec))\.(js|ts)$",
"moduleFileExtensions": ["vue", "js"],
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/src/$1"
},
"coveragePathIgnorePatterns": ["/node_modules/", "/tests/"],
"coverageReporters": ["text", "json-summary"],
"testEnvironmentOptions": {
"customExportConditions": ["node", "node-addons"]
}
}
This is my ./babel.config.json:
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-syntax-import-meta",
"babel-plugin-transform-import-meta"
],
"env
": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
}
}
And this is my ./vite.config.js:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import EnvironmentPlugin from 'vite-plugin-environment'
// https://vitejs.dev/config/
export default defineConfig({
server: {
host: true,
port: 5173,
watch: {
usePolling: true,
},
},
plugins: [
vue({
template: { transformAssetUrls },
}),
VueI18nPlugin({
include: './src/config/i18n',
}),
quasar({
sassVariables: './public/styles/sass/quasar-variables.sass',
}),
EnvironmentPlugin('all'),
],
})
Any help would be greatly appreciated.