fix: 100% code coverage

This commit is contained in:
Nolan Lawson 2023-12-16 11:42:53 -08:00
parent ef5e8166b5
commit b4c1dfb309
4 changed files with 13 additions and 14 deletions

View File

@ -1,7 +1,9 @@
import { minifyHTMLLiterals } from 'minify-html-literals'
export default {
processAsync (source) {
return minifyHTMLLiterals(source)
processAsync (source, fileName) {
return minifyHTMLLiterals(source, {
fileName
})
}
}

View File

@ -21,16 +21,10 @@ module.exports = {
],
coverageThreshold: {
global: {
statements: 95,
branches: 95,
functions: 95,
lines: 95
},
'./src/picker/components/Picker/**/*': {
statements: 90,
branches: 85,
functions: 90,
lines: 90
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
}
}

View File

@ -30,7 +30,9 @@ const baseConfig = {
name: 'minify-html-in-tag-template-literals',
transform (content, id) {
if (id.includes('PickerTemplate.js')) {
return minifyHTMLLiterals(content)
return minifyHTMLLiterals(content, {
fileName: id
})
}
}
},

View File

@ -137,8 +137,9 @@ export function render (container, state, helpers, events, actions, refs, abortS
}
</div>
<div class="indicator-wrapper">
<!-- Note we cannot test RTL in Jest because of lack of getComputedStyle() -->
<div class="indicator"
style="transform: translateX(${(state.isRtl ? -1 : 1) * state.currentGroupIndex * 100}%)">
style="transform: translateX(${(/* istanbul ignore next */ (state.isRtl ? -1 : 1)) * state.currentGroupIndex * 100}%)">
</div>
</div>