Skip to content

Commit

Permalink
EPMRPP-90262 || Setup tests for UI-kit and cover Button component (#61)
Browse files Browse the repository at this point in the history
* EPMRPP-90262 || Setup tests for UI-kit and cover Button component

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

* feat: add coverage files to gitignore

* EPMRPP-90262 || Code review fixes - 1

* EPMRPP-90262 || Code review fixes - 2
  • Loading branch information
iso9000t authored Jan 7, 2025
1 parent 6f4ff0a commit 4ee6bbc
Show file tree
Hide file tree
Showing 9 changed files with 3,251 additions and 200 deletions.
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

0 comments on commit 4ee6bbc

Please sign in to comment.