File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -73,4 +73,27 @@ describe('Utils', () => {
7373 expect ( exists ) . toBeFalsy ( ) ;
7474 } ) ;
7575 } ) ;
76+
77+ describe ( '#isJsFile' , ( ) => {
78+ it ( 'should return true if file extension is .js' , ( ) => {
79+ const isJsFile = utils . isJsFile ( './valid-file.js' ) ;
80+ expect ( isJsFile ) . toBeTruthy ( ) ;
81+ } ) ;
82+ it ( 'should return true if file extension is .jsx' , ( ) => {
83+ const isJsFile = utils . isJsFile ( './valid-file.jsx' ) ;
84+ expect ( isJsFile ) . toBeTruthy ( ) ;
85+ } ) ;
86+ it ( 'should return true if file extension is .cjs' , ( ) => {
87+ const isJsFile = utils . isJsFile ( './valid-file.cjs' ) ;
88+ expect ( isJsFile ) . toBeTruthy ( ) ;
89+ } ) ;
90+ it ( 'should return false if it is not a JS file' , ( ) => {
91+ const isJsFile = utils . isJsFile ( './invalid-file.txt' ) ;
92+ expect ( isJsFile ) . toBeFalsy ( ) ;
93+ } ) ;
94+ it ( 'should return false if it is not a JS file' , ( ) => {
95+ const isJsFile = utils . isJsFile ( './invalid-file' ) ;
96+ expect ( isJsFile ) . toBeFalsy ( ) ;
97+ } ) ;
98+ } ) ;
7699} ) ;
You can’t perform that action at this time.
0 commit comments