File tree 1 file changed +5
-16
lines changed
packages/cli/test/unit/util
1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 1
1
import { expect } from "chai" ;
2
- import child_process from "node:child_process" ;
3
2
import fs from "node:fs" ;
4
3
import path from "node:path" ;
5
4
import findUp from "find-up" ;
6
5
import { gitDataPath , readGitDataFile } from "../../../src/util/gitData/gitDataPath" ;
7
6
import { getGitData } from "../../../src/util" ;
8
7
9
- const WRITE_GIT_DATA_CMD = "npm run write-git-data" ;
10
-
11
8
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.
25
14
it ( "gitData file must exist" , ( ) => {
26
15
const gitData = readGitDataFile ( ) ;
27
16
You can’t perform that action at this time.
0 commit comments