-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correção da configuração do jest para o sonar
- Loading branch information
1 parent
8b62d63
commit 093fe60
Showing
8 changed files
with
8,054 additions
and
8,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "@testing-library/jest-dom"; | ||
|
||
const config = { | ||
reporters: [ | ||
"default", | ||
["jest-junit", { outputDirectory: "reports", outputName: "report.xml" }], | ||
], | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = "test-file-stub"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
presets: [ | ||
"@babel/preset-env", | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
runtime: "automatic", | ||
}, | ||
], | ||
"@babel/preset-typescript", | ||
], | ||
plugins: [ | ||
function () { | ||
return { | ||
visitor: { | ||
MetaProperty(path) { | ||
path.replaceWithSourceString("process"); | ||
}, | ||
}, | ||
}; | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<testExecutions version="1"> | ||
<file path="src\tests\Login.test.tsx"> | ||
<testCase name="should render Login" duration="318" /> | ||
</file> | ||
<file path="src\tests\Cadastro.test.tsx"> | ||
<testCase name="should render Login text" duration="342" /> | ||
</file> | ||
</testExecutions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
coverageReporters: ["json-summary", "text", "lcov"], | ||
collectCoverageFrom: [ | ||
"src/**/**/*.{ts,tsx}", | ||
"src/**/**/**/*.{ts,tsx}", | ||
"!src/**/**/**/*.dto.{ts,tsx}", | ||
"!src/styles/globalStyle.ts", | ||
"!src/vite-env.d.ts", | ||
"!src/index.tsx", | ||
"!src/App.tsx", | ||
], | ||
collectCoverage: true, | ||
testEnvironment: "jest-environment-jsdom", | ||
setupFilesAfterEnv: ["<rootDir>/.jest/setup-tests.js"], | ||
transform: { | ||
".*\\.[jt]sx?$": "babel-jest", | ||
}, | ||
reporters: [ | ||
"default", | ||
[ | ||
"jest-sonar", | ||
{ | ||
outputDirectory: "./", | ||
outputName: "jest-report.xml", | ||
reportedFilePath: "relative", | ||
relativeRootDir: "<rootDir>/../", | ||
}, | ||
], | ||
], | ||
moduleNameMapper: { | ||
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$": | ||
"<rootDir>/__mocks__/fileMock.js", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.