PoffM / ui-test-visualizer

1 stars 0 forks source link

jest.config.ts is not detected #2

Open swa-desmat opened 4 months ago

swa-desmat commented 4 months ago

``Good morning, I figure out an issue after installing the extension.

I've the error message: No Jest config found

A jest.config.ts file is existing in my project.

Package:

{ "name": "web", "private": true, "scripts": { "prepare": "husky install", "dev": "next dev", "build": "next build", "start": "next start", "test": "jest", "test:e2e": "playwright test", "lint": "next lint", "pipe": "node pipe.js", "codegen": "DOTENV_CONFIG_PATH=./.env.local graphql-codegen -r dotenv/config --config codegen.ts", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build" }, "dependencies": { "@contentful/live-preview": "^2.17.3", "@contentful/rich-text-plain-text-renderer": "^16.0.13", "@contentful/rich-text-react-renderer": "^15.19.6", "@graphql-codegen/cli": "^5.0.2", "@headlessui/react": "^1.7.18", "@headlessui/tailwindcss": "^0.2.0", "@heroicons/react": "^2.1.1", "@neshca/cache-handler": "^1.0.7", "@next/third-parties": "^14.1.3", "@parcel/watcher": "^2.4.1", "@popperjs/core": "^2.11.8", "@react-pdf/renderer": "^3.3.8", "@react-spring/parallax": "^9.7.3", "@react-spring/web": "^9.7.3", "@use-gesture/react": "^10.3.0", "@vercel/otel": "^1.5.0", "clsx": "^2.1.0", "commerce-sdk": "^2.14.0", "contentful": "^10.8.7", "contentful-management": "^11.24.5", "crypto": "^1.0.1", "dotenv": "^16.4.5", "graphql": "^16.8.1", "graphql-tag": "^2.12.6", "intl-messageformat": "^10.5.11", "jest-preview": "^0.3.1", "jquery": "^3.7.1", "locale-currency": "^0.0.2", "lodash.debounce": "^4.0.8", "lodash.isempty": "^4.4.0", "lodash.mergewith": "^4.6.2", "lunarphase-js": "^2.0.3", "negotiator": "^0.6.3", "next": "^14.1.4", "nextjs-progressbar": "^0.0.16", "query-string": "^9.0.0", "react": "^18.2.0", "react-app-polyfill": "^3.0.0", "react-dom": "^18.2.0", "react-hook-form": "^7.51.0", "react-icons": "^5.0.1", "react-idle-timer": "^5.7.2", "react-pdf": "^7.7.1", "react-popper": "^2.3.0", "react-to-pdf": "^1.0.1", "redis": "^4.6.13", "request-stripe": "^1.0.3", "sass": "^1.71.1", "server-only": "^0.0.1", "swiper": "^11.0.7", "swr": "^2.2.5", "usehooks-ts": "^3.0.1", "zod": "^3.22.4" }, "devDependencies": { "@babel/core": "^7.24.0", "@commitlint/cli": "^19.1.0", "@commitlint/config-conventional": "^19.1.0", "@graphql-codegen/typescript": "^4.0.6", "@graphql-codegen/typescript-generic-sdk": "^4.0.1", "@graphql-codegen/typescript-operations": "^4.2.0", "@lhci/cli": "^0.13.0", "@next/bundle-analyzer": "^14.1.3", "@playwright/test": "^1.43.1", "@semantic-release/changelog": "^6.0.3", "@semantic-release/commit-analyzer": "11.1.0", "@semantic-release/git": "^10.0.1", "@semantic-release/release-notes-generator": "^12.1.0", "@storybook/addon-a11y": "^8.0.0", "@storybook/addon-coverage": "^1.0.1", "@storybook/addon-docs": "^8.0.0", "@storybook/addon-essentials": "^8.0.0", "@storybook/addon-interactions": "^8.0.0", "@storybook/addon-links": "^8.0.0", "@storybook/addon-onboarding": "^8.0.0", "@storybook/addon-styling": "^1.3.7", "@storybook/blocks": "^8.0.0", "@storybook/nextjs": "^8.0.0", "@storybook/react": "^8.0.0", "@storybook/testing-library": "^0.2.2", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", "@testing-library/dom": "^9.3.4", "@testing-library/jest-dom": "^6.4.2", "@testing-library/react": "^14.2.1", "@testing-library/user-event": "^14.5.2", "@types/css-mediaquery": "^0", "@types/jest": "^29.5.12", "@types/jquery": "^3.5.29", "@types/k6": "^0", "@types/lodash.debounce": "^4.0.9", "@types/lodash.isempty": "^4.4.9", "@types/lodash.mergewith": "^4.6.9", "@types/negotiator": "^0.6.3", "@types/node": "^20.11.26", "@types/qs": "^6.9.12", "@types/react": "^18.2.65", "@types/react-dom": "^18.2.21", "@types/react-responsive-masonry": "^2.1.3", "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", "autoprefixer": "^10.4.18", "contentful-migration": "^4.20.1", "css-mediaquery": "^0.1.2", "eslint": "^8.57.0", "eslint-config-next": "^14.1.3", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-storybook": "^0.8.0", "husky": "^9.0.11", "install": "^0.13.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "k6": "^0.0.0", "localtunnel": "^2.0.2", "postcss": "^8.4.35", "prettier": "^3.2.5", "prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-tailwindcss": "^0.5.12", "qrcode-terminal": "^0.12.0", "resize-observer-polyfill": "^1.5.1", "semantic-release": "^23.0.2", "storybook": "^8.0.0", "tailwindcss": "^3.4.1", "ts-node": "^10.9.2", "typescript": "^5.4.2" }, "packageManager": "yarn@4.0.2", "version": "1.0.0", "publishConfig": { "access": "restricted" } }

PoffM commented 4 months ago

Thanks for letting me know about this. Are you on Windows? I just checked and looks like the file paths are detected wrong on Windows (back- vs forward-slashes).

PoffM commented 4 months ago

I pushed a new version (1.0.2) so hopefully that fixes it for you.

swa-desmat commented 4 months ago

Hi @PoffM , thanks for your answer. I'm currently working on Mac Ventura 13.6.1. Unfortunately same issue, my jest.config.ts file isn't detected.

Information about VS Code: Version: 1.89.1 (Universal) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:14:24.611Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 22.6.0

Screenshot 2024-05-15 at 07 43 35

let me know if I can make some additional tests on my side to help you.

PoffM commented 4 months ago

I don't have a Mac so can't verify myself if the config detection ever worked on it (though the detection works running the CI tests in macos).

Other guesses I have:

swa-desmat commented 4 months ago

Hi @PoffM , the jest.config.ts file is located in the top level of the project.

I'll see if I can do the same test in another project and on a colleague's Mac. I'll let you know as soon as I've done these tests.

PoffM commented 4 months ago

I just pushed another version (1.0.3) to improve the Jest config file handling.

swa-desmat commented 4 months ago

Thanks, it's seems now good, the file is now well detected. I've another issue when I run the Visual test:

Jest: Failed to parse the TypeScript config file jest.config.ts TypeError: Invalid host defined options

I'm checking on my side, I found some post relative with Prettier.