11
11
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
12
12
13
13
import * as path from 'path' ;
14
- import { promises as fs } from 'fs' ;
14
+ import * as fs from 'fs' ;
15
15
import { expect } from 'chai' ;
16
16
import * as shell from 'shelljs' ;
17
17
@@ -36,7 +36,7 @@ describe('forceignore changes', () => {
36
36
`sfdx force:apex:class:create -n IgnoreTest --outputdir ${ classdir } ` ,
37
37
] ,
38
38
} ) ;
39
- originalForceIgnore = await fs . readFile ( path . join ( session . project . dir , '.forceignore' ) , 'utf8' ) ;
39
+ originalForceIgnore = await fs . promises . readFile ( path . join ( session . project . dir , '.forceignore' ) , 'utf8' ) ;
40
40
conn = await Connection . create ( {
41
41
authInfo : await AuthInfo . create ( {
42
42
username : ( session . setup [ 0 ] as { result : { username : string } } ) . result ?. username ,
@@ -53,7 +53,7 @@ describe('forceignore changes', () => {
53
53
it ( 'will not push a file that was created, then ignored' , async ( ) => {
54
54
// setup a forceIgnore with some file
55
55
const newForceIgnore = originalForceIgnore + '\n' + `${ classdir } /IgnoreTest.cls` ;
56
- await fs . writeFile ( path . join ( session . project . dir , '.forceignore' ) , newForceIgnore ) ;
56
+ await fs . promises . writeFile ( path . join ( session . project . dir , '.forceignore' ) , newForceIgnore ) ;
57
57
// nothing should push
58
58
const output = execCmd < PushPullResponse [ ] > ( 'force:source:push --json' , { ensureExitCode : 0 } ) . jsonOutput . result ;
59
59
expect ( output ) . to . deep . equal ( [ ] ) ;
@@ -63,7 +63,7 @@ describe('forceignore changes', () => {
63
63
// setup a forceIgnore with some file
64
64
const newForceIgnore =
65
65
originalForceIgnore + '\n' + `${ classdir } /UnIgnoreTest.cls` + '\n' + `${ classdir } /IgnoreTest.cls` ;
66
- await fs . writeFile ( path . join ( session . project . dir , '.forceignore' ) , newForceIgnore ) ;
66
+ await fs . promises . writeFile ( path . join ( session . project . dir , '.forceignore' ) , newForceIgnore ) ;
67
67
68
68
// add a file in the local source
69
69
shell . exec ( `sfdx force:apex:class:create -n UnIgnoreTest --outputdir ${ classdir } ` , {
@@ -79,7 +79,7 @@ describe('forceignore changes', () => {
79
79
80
80
it ( 'will push files that are now un-ignored' , async ( ) => {
81
81
// un-ignore the file
82
- await fs . writeFile ( path . join ( session . project . dir , '.forceignore' ) , originalForceIgnore ) ;
82
+ await fs . promises . writeFile ( path . join ( session . project . dir , '.forceignore' ) , originalForceIgnore ) ;
83
83
84
84
// verify file pushed in results
85
85
const unIgnoredOutput = execCmd < PushPullResponse [ ] > ( 'force:source:push --json' , { ensureExitCode : 0 } ) . jsonOutput
@@ -105,7 +105,10 @@ describe('forceignore changes', () => {
105
105
106
106
it ( 'will not pull a remote file added to the ignore AFTER it is being tracked' , async ( ) => {
107
107
// add that type to the forceignore
108
- await fs . writeFile ( path . join ( session . project . dir , '.forceignore' ) , originalForceIgnore + '\n' + classdir ) ;
108
+ await fs . promises . writeFile (
109
+ path . join ( session . project . dir , '.forceignore' ) ,
110
+ originalForceIgnore + '\n' + classdir
111
+ ) ;
109
112
110
113
// gets file into source tracking
111
114
const statusOutput = execCmd < StatusResult [ ] > ( 'force:source:status --json --remote' , { ensureExitCode : 0 } )
0 commit comments