Skip to content

Commit

Permalink
fix: [PIE-3167]: Fix Cypress Coverage task (#7892)
Browse files Browse the repository at this point in the history
* fix: [PIE-3167]: Fix Cypress Coverage task

* fix: [PIE-3167]: Fix Cypress Coverage task

* fix: [PIE-3167]: Fix Cypress Coverage task

Co-authored-by: Vivek Kumar Bansal <[email protected]>
  • Loading branch information
kapilkumawat86 and vkbansal-harness authored Mar 21, 2022
1 parent 4d7ae83 commit 2439fde
Show file tree
Hide file tree
Showing 4 changed files with 1,109 additions and 428 deletions.
42 changes: 36 additions & 6 deletions configs/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,46 @@ if (isCypress && isCypressCoverage) {
}
}
})(mergedConfig, {
module: {
rules: [
{
test: /\.(j|t)sx?$/,
use: [
{
loader: 'babel-loader'
}
]
}
]
}
})

mergedConfig = mergeWithRules({
module: {
rules: {
test: /\.(j|t)sx?$/,
use: [
{
loader: 'babel-loader'
}
]
test: 'match',
use: {
loader: 'match',
options: 'replace'
}
}
}
})(mergedConfig, {
module: {
rules: [
{
test: /\.(j|t)sx?$/,
use: [
{
loader: 'swc-loader',
options: {
parseMap: true
}
}
]
}
]
}
})
} else {
mergedConfig.plugins.push(new ForkTsCheckerWebpackPlugin())
Expand Down
4 changes: 2 additions & 2 deletions mergedCoverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ fs.emptyDirSync(FINAL_OUTPUT_FOLDER)
run([
// "nyc merge" will create a "coverage.json" file on the FINAL_OUTPUT_FOLDER
`nyc merge ${REPORTS_FOLDER} ${FINAL_OUTPUT_FOLDER}/merged-coverage.json`,
`nyc report -t ${FINAL_OUTPUT_FOLDER} --reporter lcov --reporter json-summary --report-dir ${FINAL_OUTPUT_FOLDER}`
])
`nyc report -t ${FINAL_OUTPUT_FOLDER} --reporter html --reporter json-summary --report-dir ${FINAL_OUTPUT_FOLDER}`
])
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@cypress/code-coverage": "^3.9.11",
"@cypress/code-coverage": "^3.9.12",
"@cypress/webpack-preprocessor": "^5.11.1",
"@emotion/react": "^11.4.0",
"@graphql-codegen/cli": "^2.6.2",
Expand Down Expand Up @@ -175,7 +175,7 @@
"case": "^1.6.3",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^6.3.0",
"cypress": "^8.4.1",
"cypress": "^9.5.2",
"dotenv": "^10.0.0",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
Expand Down
Loading

0 comments on commit 2439fde

Please sign in to comment.