Skip to content

Commit 1d2ccd5

Browse files
hemal7735evenstensberg
authored andcommitted
feat: add util to run-and-get watch proc
1 parent e9e1dcb commit 1d2ccd5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎test/testUtils.js‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ function runWatch(testCase, args = []) {
5959
});
6060
}
6161

62+
functionrunAndGetWatchProc(testCase,args=[]){
63+
constcwd=path.resolve(testCase);
64+
65+
constoutputPath=path.resolve(testCase,"bin");
66+
constargsWithOutput=args.concat("--output-path",outputPath);
67+
68+
constwebpackProc=execa(WEBPACK_PATH,argsWithOutput,{
69+
cwd,
70+
reject: false
71+
});
72+
73+
returnwebpackProc;
74+
}
75+
6276
functionextractSummary(stdout){
6377
if(stdout===""){
6478
return"";
@@ -167,4 +181,4 @@ function appendDataIfFileExists(testCase, file, data) {
167181
}
168182
}
169183

170-
module.exports={ run, runWatch, extractHash, extractSummary, appendDataIfFileExists };
184+
module.exports={ run, runWatch,runAndGetWatchProc,extractHash, extractSummary, appendDataIfFileExists };

0 commit comments

Comments
 (0)