File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 66const path = require ( "path" ) ;
77
88describe ( ".env" , ( ) => {
9+ const filePath = path . join ( process . cwd ( ) , ".env" ) ;
910 it ( "should have a file" , async ( ) => {
10- const filePath = path . join ( process . cwd ( ) , ".env" ) ;
1111 const hasEnv = await stat ( filePath , F_OK , err => {
1212 if ( err ) {
1313 console . error ( err ) ;
@@ -30,4 +30,16 @@ describe(".env", () => {
3030 }
3131 assert . ok ( hasMatch , ".env is not added to the .gitignore file" ) ;
3232 } ) ;
33+ // 6.3
34+ it ( 'should have the key MESSAGE_STYLE with a value "uppercase"' , async ( ) => {
35+ const envFile = await readFile ( filePath , "utf8" ) ;
36+ const lines = envFile . split ( "\n" ) ;
37+ let hasMatch = false ;
38+ for ( const line of lines ) {
39+ if ( line . match ( / ^ M E S S A G E _ S T Y L E / ) ) {
40+ hasMatch = ! ! line . match ( / ( \" \' ) ? u p p e r c a s e ( \" \' ) ? / ) ;
41+ }
42+ }
43+ assert . ok ( hasMatch , 'MESSAGE_STYLE should equal "uppercase"' ) ;
44+ } ) ;
3345} ) ;
You can’t perform that action at this time.
0 commit comments