diff --git a/container/coverage-summary.js b/container/coverage-summary.js index 53b6b09f09..cbb2362e66 100644 --- a/container/coverage-summary.js +++ b/container/coverage-summary.js @@ -18,12 +18,12 @@ try { console.log('

Source file for e2e tests not found!

'); } -const fileList = unitData ? Object.keys(unitData).filter(key => key !== 'total') : []; -const sortedList = fileList.map(item => item.split('\\').pop()).sort(); +const fileList = unitData ? Object.keys(unitData).filter((key) => key !== 'total') : []; +const sortedList = fileList.map((item) => item.split('\\').pop()).sort(); const parseData = (data, name) => { return Object.entries( Object.keys(data) - .filter(key => key.includes(name)) + .filter((key) => key.includes(name)) .reduce((obj, key) => data[key], {}) ); }; @@ -121,9 +121,8 @@ function buildHtml() { return table; }; - const totalTable = unitTotal && e2eTotal - ? buildTable(unitTotal, e2eTotal) - : '

Not enough data to show results :(

'; + const totalTable = + unitTotal && e2eTotal ? buildTable(unitTotal, e2eTotal) : '

Not enough data to show results :(

'; let fileData = ''; if (unitData && e2eData) { @@ -131,7 +130,7 @@ function buildHtml() { const headline = `

Stats for '${sortedList[i]}'

`; const unitOutput = parseData(unitData, `\\${sortedList[i]}`); const e2eOutput = parseData(e2eData, `\\${sortedList[i]}`); - let table = '

Not enough data for this file :(

' + let table = '

Not enough data for this file :(

'; if (unitOutput && e2eOutput) { table = buildTable(unitOutput, e2eOutput); @@ -200,7 +199,7 @@ function buildHtml() { ${header} ${body} `; -}; +} const html = buildHtml(); diff --git a/container/jest.config.js b/container/jest.config.js index 717afc84bf..74216c21fc 100644 --- a/container/jest.config.js +++ b/container/jest.config.js @@ -1,11 +1,11 @@ -module.exports = async () => { - return { - verbose: true, - testEnvironment: 'jsdom', - roots: ['test'], - collectCoverage: true, - collectCoverageFrom: ['src/**/*.{js,mjs,ts,svelte}', '!**/node_modules/**', '!**/vendor/**', '!**/*.spec.{js,ts}'], - coverageReporters: ['clover', 'json', 'json-summary', 'lcov', 'text'], - coverageDirectory: 'coverage' - }; -}; +module.exports = async () => { + return { + verbose: true, + testEnvironment: 'jsdom', + roots: ['test'], + collectCoverage: true, + collectCoverageFrom: ['src/**/*.{js,mjs,ts,svelte}', '!**/node_modules/**', '!**/vendor/**', '!**/*.spec.{js,ts}'], + coverageReporters: ['clover', 'json', 'json-summary', 'lcov', 'text'], + coverageDirectory: 'coverage' + }; +};