Skip to content

Commit

Permalink
test: debug windows ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Apr 21, 2023
1 parent 1becb2b commit 4331072
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/workspaces/coverage-report-tests/check-coverage.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { existsSync, readFileSync } from 'node:fs'
import { normalize } from 'node:path'
import { expect, test } from 'vitest'
import libCoverage from 'istanbul-lib-coverage'
import { normalize, resolve } from 'pathe'
import { normalize as patheNormalize, resolve } from 'pathe'

test('coverage exists', () => {
expect(existsSync('./coverage')).toBe(true)
Expand All @@ -11,6 +12,12 @@ test('coverage exists', () => {
test('file coverage summary matches', () => {
const coverageJson = JSON.parse(readFileSync('./coverage/coverage-final.json', 'utf-8'))
const coverageMap = libCoverage.createCoverageMap(coverageJson)

/* eslint-disable no-console */
console.log('coverageMap', coverageMap)
console.log('node:fs normalize', normalize(resolve('./src/math.ts')))
console.log('pathe normalize', patheNormalize(resolve('./src/math.ts')))

const fileCoverage = coverageMap.fileCoverageFor(normalize(resolve('./src/math.ts')))

// There should be 1 uncovered branch and 1 uncovered function. See math.ts.
Expand Down

0 comments on commit 4331072

Please sign in to comment.