Skip to content

Commit

Permalink
set up configuration for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
helios2003 committed Sep 9, 2024
1 parent e319a47 commit ce5d906
Show file tree
Hide file tree
Showing 3 changed files with 5,528 additions and 4,412 deletions.
27 changes: 22 additions & 5 deletions apps/studio-next/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
module.exports = {
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
}
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;
}
9 changes: 6 additions & 3 deletions apps/studio-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"lint": "echo 'No linting configured'",
"test": "jest"
"test:unit": "jest",
"lint": "echo 'No linting configured'"
},
"dependencies": {
"@asyncapi/avro-schema-parser": "^3.0.19",
Expand Down Expand Up @@ -49,7 +49,7 @@
"reactflow": "^11.2.0",
"tailwindcss": "3.3.3",
"tippy.js": "^6.3.7",
"ts-jest": "^29.2.4",
"ts-jest": "^29.2.5",
"typescript": "5.1.6",
"zustand": "^4.5.2"
},
Expand Down Expand Up @@ -83,6 +83,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
Loading

0 comments on commit ce5d906

Please sign in to comment.