@@ -6,12 +6,27 @@ const rimraf = require("rimraf");
6
6
const os = require ( "os" ) ;
7
7
const { resolve } = require ( "path" ) ;
8
8
9
- const prettierTest = async ( ) => {
9
+ const prettierTestWithoutForce = async ( ) => {
10
10
const packageName = "prettier" ;
11
- const rootPath = resolve ( os . tmpdir ( ) , "./test-assets" ) ;
12
- const cliArgs = [ "init" , rootPath , "--force" ] ;
13
- const logMessage = "Do you like to install prettier to format generated configuration?" ;
14
- const status = await runTestStdout ( { packageName, cliArgs, logMessage } ) ;
11
+ const rootPath = resolve ( os . tmpdir ( ) , "./test-assets-2" ) ;
12
+ const cliArgs = [ "init" , rootPath ] ;
13
+ const inputs = {
14
+ "Which of the following JS solutions do you want to use?" : `\n` ,
15
+ "Do you want to use webpack-dev-server?" : `n\n` ,
16
+ "Do you want to simplify the creation of HTML files for your bundle?" : `n\n` ,
17
+ "Do you want to add PWA support?" : `n\n` ,
18
+ "Which of the following CSS solutions do you want to use?" : "\n" ,
19
+ "Do you like to install prettier to format generated configuration?" : `n\n` ,
20
+ "Pick a package manager" : "\n" ,
21
+ } ;
22
+ const logMessage =
23
+ "Generated configuration may not be properly formatted as prettier is not installed" ;
24
+ const status = await runTestStdoutWithInput ( {
25
+ packageName,
26
+ cliArgs,
27
+ inputs,
28
+ logMessage,
29
+ } ) ;
15
30
rimraf . sync ( rootPath ) ;
16
31
return status ;
17
32
} ;
@@ -20,20 +35,16 @@ const prettierTestWithNoAnswer = async () => {
20
35
const packageName = "prettier" ;
21
36
const rootPath = resolve ( os . tmpdir ( ) , "./test-assets-2" ) ;
22
37
const cliArgs = [ "init" , rootPath , "--force" ] ;
23
- const inputs = {
24
- "Do you like to install prettier to format generated configuration?" : "n\n" ,
25
- } ;
26
38
const logMessage =
27
39
"Generated configuration may not be properly formatted as prettier is not installed" ;
28
- const status = await runTestStdoutWithInput ( {
40
+ const status = await runTestStdout ( {
29
41
packageName,
30
42
cliArgs,
31
- inputs,
32
43
logMessage,
33
44
} ) ;
34
45
rimraf . sync ( rootPath ) ;
35
46
return status ;
36
47
} ;
37
48
38
- module . exports . run = [ prettierTest , prettierTestWithNoAnswer ] ;
49
+ module . exports . run = [ prettierTestWithoutForce , prettierTestWithNoAnswer ] ;
39
50
module . exports . name = "Missing prettier" ;
0 commit comments