Skip to content

Commit

Permalink
Merge pull request #339 from vinho-notas/VIN-173-Criar-testes-unitari…
Browse files Browse the repository at this point in the history
…os-com-Jest-para-o-Frontend

Vin 173 criar testes unitarios com jest para o frontend
  • Loading branch information
vanderleik authored Apr 11, 2024
2 parents bb57d8b + ae3904a commit a654a7c
Show file tree
Hide file tree
Showing 37 changed files with 9,446 additions and 2,559 deletions.
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ dist-ssr
*.sw?

.env

coverage
1 change: 1 addition & 0 deletions frontend/.jest/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
1 change: 1 addition & 0 deletions frontend/.jest/mocks/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
6 changes: 6 additions & 0 deletions frontend/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env", { "targets": { "esmodules": true } }],
["@babel/preset-react", { "runtime": "automatic" }]
]
}
9 changes: 9 additions & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
testEnvironment: 'jest-environment-jsdom',
setupFilesAfterEnv: ['<rootDir>/.jest/jest.setup.js'],
moduleNameMapper: {
'\\.(gif|tff|eot|svg|png)$': '<rootDir>/.jest/mocks/fileMock.js',
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
},

}
Loading

0 comments on commit a654a7c

Please sign in to comment.