Skip to content

Commit

Permalink
chore(RHINENG-16215) fix cypress coverage and collection (#580)
Browse files Browse the repository at this point in the history
* fix cypress coverage and collection

* update gitignore

* fix lint errors
  • Loading branch information
opacut authored Feb 26, 2025
1 parent 93106df commit e0c79be
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ yarn-debug.log*
yarn-error.log*

.DS_Store
coverage

## build stuff
build
Expand All @@ -27,9 +26,10 @@ cypress/downloads
cypress/screenshots
cypress/videos

codecov*
.nyc_output/
reports/
coverage
coverage/*
coverage-*

# cache
.cache/
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
- stage: Lint
script: npm run lint
- stage: Test
script: npm run test && npm run test:ct && npm run coverage
script: npm run travis:verify
- stage: Build
script: npm run build
env:
global:
- BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
Expand Down
13 changes: 12 additions & 1 deletion config/cypress.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@ webpackConfig.module.rules.push({

module.exports = {
...webpackConfig,
plugins
plugins,
module: {
...webpackConfig.module,
rules: [
...webpackConfig.module.rules,
{
test: /\.(?:js|mjs|cjs)$/,
exclude: /(node_modules|bower_components)/i,
use: ['babel-loader']
}
]
}
};
19 changes: 0 additions & 19 deletions coverage.sh

This file was deleted.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,26 @@
"lint:js:fix": "eslint config src --fix",
"lint:sass": "stylelint 'src/**/*.scss' --config .stylelintrc.json",
"nightly": "npm run travis:verify",
"postinstall": "ts-patch install",
"server:ctr": "node src/server/generateServerKey.js",
"start": "fec dev",
"start:proxy": "PROXY=true fec dev",
"test": "jest --verbose",
"test": "jest --passWithNoTests",
"test:coverage": "curl -sSL 'https://raw.githubusercontent.com/RedHatInsights/insights-interact-tools/refs/heads/main/scripts/coverage.sh' | bash",
"test:ct": "BABEL_ENV=componentTest cypress run --component",
"test:openct": "cypress open --component",
"translations": "npm-run-all translations:*",
"translations:extract": "npx formatjs extract ./src/*.js --out-file ./build/messages/src/Messages.json",
"translations:compile": "npx formatjs compile ./build/messages/src/Messages.json --out-file ./locales/translations.json",
"travis:verify": "npm-run-all build lint test",
"verify": "npm-run-all build lint test",
"coverage": "bash coverage.sh",
"postinstall": "ts-patch install"
"travis:verify": "npm run test:coverage"
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,jsx}",
"!**/node_modules/**"
],
"coverageDirectory": "./codecov-jest/",
"coverageDirectory": "coverage-jest",
"moduleNameMapper": {
"\\.(css|less|scss|sass|svg|png)$": "identity-obj-proxy"
},
Expand Down Expand Up @@ -127,12 +126,13 @@
"appname": "dashboard"
},
"nyc": {
"report-dir": "codecov-cypress",
"report-dir": "coverage-cypress",
"include": [
"src/**/*"
"src/**/*.{js,tsx}"
],
"exclude": [
"src/**/*.test.js"
"src/**/*.test.js",
"src/**/*.cy.js"
]
}
}

0 comments on commit e0c79be

Please sign in to comment.