Skip to content

Commit

Permalink
support-unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Sep 7, 2024
1 parent 1c7f5b2 commit b9b1f59
Show file tree
Hide file tree
Showing 4 changed files with 2,138 additions and 364 deletions.
23 changes: 23 additions & 0 deletions apps/studio-next/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Config } from 'jest'
import nextJest from 'next/jest.js'

const createJestConfig = nextJest();
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.yml$': 'jest-transform-yaml',
'^.+\\.yaml$': 'jest-transform-yaml',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
};

const asyncConfig = createJestConfig(config);

module.exports = async () => {
const config = await asyncConfig();
config.transformIgnorePatterns = ['node_modules/.pnpm/(?!@asyncapi/react-component|monaco-editor)/'];
return config;
}
5 changes: 5 additions & 0 deletions apps/studio-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"test:unit": "jest",
"lint": "echo 'No linting configured'"
},
"dependencies": {
Expand Down Expand Up @@ -43,6 +44,7 @@
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"tippy.js": "^6.3.7",
"ts-jest": "^29.2.5",
"typescript": "5.1.6",
"zustand": "^4.5.2"
},
Expand Down Expand Up @@ -76,6 +78,9 @@
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-sonarjs": "^0.16.0",
"https-browserify": "^1.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-yaml": "^1.1.2",
"markdown-toc": "^1.2.0",
"path-browserify": "^1.0.1",
"postcss": "^8.4.31",
Expand Down
2 changes: 1 addition & 1 deletion apps/studio-next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
Expand Down
Loading

0 comments on commit b9b1f59

Please sign in to comment.