Skip to content

Commit c0f0fc4

Browse files
authored
Merge 41de0f0 into 01e6ffe
2 parents 01e6ffe + 41de0f0 commit c0f0fc4

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

packages/cli/test/unit/util/gitData.test.ts

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
11
import {expect} from "chai";
2-
import child_process from "node:child_process";
32
import fs from "node:fs";
43
import path from "node:path";
54
import findUp from "find-up";
65
import {gitDataPath, readGitDataFile} from "../../../src/util/gitData/gitDataPath";
76
import {getGitData} from "../../../src/util";
87

9-
const WRITE_GIT_DATA_CMD = "npm run write-git-data";
10-
118
describe("util / gitData", function () {
12-
// In CI, the below before() function takes time
13-
this.timeout(3000);
14-
15-
before(() => {
16-
const pkgJsonPath = findUp.sync("package.json", {cwd: __dirname});
17-
if (!pkgJsonPath) {
18-
throw Error("No package.json found");
19-
}
20-
21-
const pkgJsonDir = path.resolve(path.dirname(pkgJsonPath));
22-
child_process.execSync(WRITE_GIT_DATA_CMD, {cwd: pkgJsonDir});
23-
});
24-
9+
// .gitData file is created at build time with the command
10+
// ```
11+
// npm run write-git-data
12+
// ```
13+
// If this step fails run that command. This could happen when running tests before building.
2514
it("gitData file must exist", () => {
2615
const gitData = readGitDataFile();
2716

0 commit comments

Comments
 (0)