Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-90262 || Setup tests for UI-kit and cover Button component #61

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ module.exports = {
root: true,
env: {
browser: true,
es2020: true
es2020: true,
},
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:storybook/recommended',
"plugin:prettier/recommended",
"plugin:import/recommended",
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'coverage', 'vitest.config.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
Expand All @@ -24,14 +24,17 @@ module.exports = {
typescript: {
alwaysTryTypes: true,
project: ['./tsconfig.eslint.json'],
}
}
},
},
},
plugins: ['react-refresh', 'prettier', 'react'],
rules: {
'react-refresh/only-export-components': ['warn', {
allowConstantExport: true
}],
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]
}
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
},
};
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Test coverage
coverage
.coverage
coverage.json
*.lcov
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,27 @@ The CSS custom properties that come from DS are prefixed with `rp-ui-base` to av

### Testing

To be provided.
#### Testing Tools

The project uses the following testing tools:
- **Vitest**: Fast testing framework, compatible with Vite
- **React Testing Library**: For testing React components with a focus on user interactions
- **@testing-library/user-event**: For simulating user events in tests
- **JSDOM**: For simulating a DOM environment in Node.js
- **@vitest/coverage-v8**: For code coverage reporting

#### Test Scripts

Available npm scripts for testing:
- `npm run test` - Run tests in watch mode
- `npm run test:coverage` - Run tests with coverage report
- `npm run test:ci` - Run tests once (for CI environments)
- `npm run test:ui` - Run tests with UI interface

#### Test Coverage

The project maintains a minimum of 80% test coverage threshold for:
- Statements
- Branches
- Functions
- Lines
Loading
Loading