UNPKG

901 BJavaScriptView Raw
1'use strict'
2
3const {
4 ExecutedLint,
5 ExecutedTestCoverage,
6 ExecutedTestCoverageCheck,
7 ExecutedTestCoverageReport,
8 LoggedTotalCoverageByJsonSummary
9} = require('@cuties/wall')
10const { ReadDataByPath } = require('@cuties/fs')
11const { ParsedJSON } = require('@cuties/json')
12
13new ExecutedLint(process, './src', './test').after(
14 new ExecutedTestCoverageReport(
15 new ExecutedTestCoverageCheck(
16 new ExecutedTestCoverage(
17 process, './test-executor.js'
18 ),
19 { lines: 100, functions: 100, branches: 100, statements: 100 }
20 ), 'json-summary'
21 ).after(
22 new LoggedTotalCoverageByJsonSummary(
23 new ParsedJSON(
24 new ReadDataByPath('coverage/coverage-summary.json', { encoding: 'utf8' })
25 ), (linesPct, statementsPct, functionsPct, branchesPct) => {
26 return (linesPct + statementsPct + functionsPct + branchesPct) / 4
27 }
28 )
29 )
30).call()