Skip to content

Commit 0936c30

Browse files
committed
Replace nonexistent getCwd with process.cwd() in coverage script
1 parent 0ded887 commit 0936c30

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

scripts/get-coverage-percentage.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import yargsParser from 'yargs-parser'
44

55
import constants from '@socketsecurity/registry/lib/constants'
66
import { logger } from '@socketsecurity/registry/lib/logger'
7-
import { getCwd, resolve } from '@socketsecurity/registry/lib/path'
7+
import { resolve } from '@socketsecurity/registry/lib/path'
88
import { indentString } from '@socketsecurity/registry/lib/strings'
99

1010
import { getCodeCoverage } from './utils/get-code-coverage.mjs'
@@ -18,7 +18,7 @@ async function logCoveragePercentage(argv) {
1818
const { spinner } = constants
1919

2020
// Check if coverage data exists to determine whether to generate or read it.
21-
const coverageJsonPath = resolve(getCwd(), 'coverage', 'coverage-final.json')
21+
const coverageJsonPath = resolve(process.cwd(), 'coverage', 'coverage-final.json')
2222

2323
// Get code coverage metrics (statements, branches, functions, lines).
2424
let codeCoverage

scripts/utils/get-code-coverage.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { existsSync } from 'node:fs'
2+
import { resolve } from 'node:path'
23

34
import constants from '@socketsecurity/registry/lib/constants'
45
import { readJson } from '@socketsecurity/registry/lib/fs'
56
import { isObjectObject } from '@socketsecurity/registry/lib/objects'
6-
import { getCwd, resolve } from '@socketsecurity/registry/lib/path'
77
import { spawn } from '@socketsecurity/registry/lib/spawn'
88

99
function countCovered(counts) {
@@ -13,7 +13,11 @@ function countCovered(counts) {
1313
export async function getCodeCoverage(options = {}) {
1414
const { generateIfMissing = true } = { __proto__: null, ...options }
1515

16-
const coverageJsonPath = resolve(getCwd(), 'coverage', 'coverage-final.json')
16+
const coverageJsonPath = resolve(
17+
process.cwd(),
18+
'coverage',
19+
'coverage-final.json',
20+
)
1721

1822
if (!existsSync(coverageJsonPath)) {
1923
if (!generateIfMissing) {

0 commit comments

Comments
 (0)