Skip to content

Commit

Permalink
Fixes Prettier issues
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Feb 6, 2025
1 parent 31de0b9 commit a85c703
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
15 changes: 7 additions & 8 deletions container/coverage-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ try {
console.log('<p style="color:red">Source file for e2e tests not found!</p>');
}

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], {})
);
};
Expand Down Expand Up @@ -121,17 +121,16 @@ function buildHtml() {

return table;
};
const totalTable = unitTotal && e2eTotal
? buildTable(unitTotal, e2eTotal)
: '<p>Not enough data to show results :(</p>';
const totalTable =
unitTotal && e2eTotal ? buildTable(unitTotal, e2eTotal) : '<p>Not enough data to show results :(</p>';
let fileData = '';

if (unitData && e2eData) {
for (let i = 0; i < sortedList.length; i++) {
const headline = `<h2>Stats for '${sortedList[i]}'</h2>`;
const unitOutput = parseData(unitData, `\\${sortedList[i]}`);
const e2eOutput = parseData(e2eData, `\\${sortedList[i]}`);
let table = '<p>Not enough data for this file :(</p>'
let table = '<p>Not enough data for this file :(</p>';

if (unitOutput && e2eOutput) {
table = buildTable(unitOutput, e2eOutput);
Expand Down Expand Up @@ -200,7 +199,7 @@ function buildHtml() {
<head>${header}</head>
<body>${body}</body>
</html>`;
};
}

const html = buildHtml();

Expand Down
22 changes: 11 additions & 11 deletions container/jest.config.js
Original file line number Diff line number Diff line change
@@ -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'
};
};

0 comments on commit a85c703

Please sign in to comment.