test(ci): remove suite-order mock coupling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { execFileSync } from "node:child_process"
|
||||
import { readFileSync } from "node:fs"
|
||||
import * as childProcess from "node:child_process"
|
||||
import * as fs from "node:fs"
|
||||
import { join } from "node:path"
|
||||
import { parseGitStatusPorcelain } from "./parse-status-porcelain"
|
||||
import { parseGitDiffNumstat } from "./parse-diff-numstat"
|
||||
@@ -7,21 +7,21 @@ import type { GitFileStat } from "./types"
|
||||
|
||||
export function collectGitDiffStats(directory: string): GitFileStat[] {
|
||||
try {
|
||||
const diffOutput = execFileSync("git", ["diff", "--numstat", "HEAD"], {
|
||||
const diffOutput = childProcess.execFileSync("git", ["diff", "--numstat", "HEAD"], {
|
||||
cwd: directory,
|
||||
encoding: "utf-8",
|
||||
timeout: 5000,
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
}).trimEnd()
|
||||
|
||||
const statusOutput = execFileSync("git", ["status", "--porcelain"], {
|
||||
const statusOutput = childProcess.execFileSync("git", ["status", "--porcelain"], {
|
||||
cwd: directory,
|
||||
encoding: "utf-8",
|
||||
timeout: 5000,
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
}).trimEnd()
|
||||
|
||||
const untrackedOutput = execFileSync("git", ["ls-files", "--others", "--exclude-standard"], {
|
||||
const untrackedOutput = childProcess.execFileSync("git", ["ls-files", "--others", "--exclude-standard"], {
|
||||
cwd: directory,
|
||||
encoding: "utf-8",
|
||||
timeout: 5000,
|
||||
@@ -34,7 +34,7 @@ export function collectGitDiffStats(directory: string): GitFileStat[] {
|
||||
.filter(Boolean)
|
||||
.map((filePath) => {
|
||||
try {
|
||||
const content = readFileSync(join(directory, filePath), "utf-8")
|
||||
const content = fs.readFileSync(join(directory, filePath), "utf-8")
|
||||
const lineCount = content.split("\n").length - (content.endsWith("\n") ? 1 : 0)
|
||||
return `${lineCount}\t0\t${filePath}`
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user