push
github
503 of 772 branches covered (0.0%)
34 of 65 new or added lines in 14 files covered. (52.31%)
13502 existing lines in 185 files now uncovered.9060 of 34265 relevant lines covered (26.44%)
11.53 hits per line
UNCOV
1
|
import wrap from './minimalHalJsonVuex.js' |
|
UNCOV
2
|
import createI18n from './i18n.js' |
× |
UNCOV
3
|
import { render, prepare } from '@/pdf/pdf.mjs' |
× |
UNCOV
4
|
|
× |
5 |
export const renderPdf = async ({ config, storeData, translationData }) => {
|
× |
6 |
const result = { |
× |
UNCOV
7
|
filename: null, |
× |
UNCOV
8
|
blob: null, |
× |
UNCOV
9
|
error: null, |
× |
UNCOV
10
|
} |
× |
UNCOV
11
|
|
× |
12 |
try {
|
× |
13 |
const { translate } = createI18n(translationData, storeData.lang.language) |
× |
14 |
const store = wrap(storeData.api) |
× |
UNCOV
15
|
|
× |
16 |
if (typeof prepare === 'function') { |
× |
17 |
await prepare(config) |
× |
UNCOV
18
|
} |
× |
UNCOV
19
|
|
× |
20 |
config.camp = store.get(config.camp) |
× |
21 |
const props = { config, store, $tc: translate, locale: storeData.lang.language } |
× |
UNCOV
22
|
|
× |
23 |
result.filename = config.documentName |
× |
24 |
result.blob = await render(props).toBlob() |
× |
UNCOV
25
|
} catch (error) {
|
× |
26 |
result.error = error |
× |
UNCOV
27
|
} |
× |
UNCOV
28
|
|
× |
29 |
return result
|
× |
UNCOV
30
|
} |
× |