The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
[CI][FIX] Storybook coverage configuration injection per scope (#9711)
Paul Rastoin55feeaeef11f
diff --git a/.github/workflows/ci-front.yaml b/.github/workflows/ci-front.yamlindex 73ae1e63297..f22bbb556da 100644--- a/.github/workflows/ci-front.yaml+++ b/.github/workflows/ci-front.yaml@@ -119,7 +119,7 @@ jobs:mkdir -p ${{ env.PATH_TO_COVERAGE }}npx nyc merge coverage-artifacts ${{ env.PATH_TO_COVERAGE }}/coverage-storybook.json- name: Checking coverage- run: npx nx storybook:coverage twenty-front --checkCoverage=true+ run: npx nx storybook:coverage twenty-front --checkCoverage=true --configuration=${{ matrix.storybook_scope }}front-chromatic-deployment:timeout-minutes: 30if: contains(github.event.pull_request.labels.*.name, 'run-chromatic') || github.event_name == 'push'diff --git a/packages/twenty-front/nyc.config.cjs b/packages/twenty-front/nyc.config.cjsindex 94a92b282ce..dad206f92ef 100644--- a/packages/twenty-front/nyc.config.cjs+++ b/packages/twenty-front/nyc.config.cjs@@ -1,3 +1,4 @@+// @ts-checkconst globalCoverage = {branches: 23,statements: 39,@@ -31,13 +32,18 @@ const performanceCoverage = {exclude: ['src/generated/**/*', 'src/modules/**/*', 'src/**/*.ts'],};-const storybookStoriesFolders = process.env.STORYBOOK_SCOPE;+const getCoverageConfig = () => {+ const storybookStoriesFolders = process.env.STORYBOOK_SCOPE;+ switch (storybookStoriesFolders) {+ case 'pages':+ return pagesCoverage;+ case 'modules':+ return modulesCoverage;+ case 'performance':+ return performanceCoverage;+ default:+ return globalCoverage;+ }+};-module.exports =- storybookStoriesFolders === 'pages'- ? pagesCoverage- : storybookStoriesFolders === 'modules'- ? modulesCoverage- : storybookStoriesFolders === 'performance'- ? performanceCoverage- : globalCoverage;+module.exports = getCoverageConfig();