File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ export class CLIUtils {
11
11
public static readonly allowedConfigFileExtensions : string [ ] = [
12
12
'.js' ,
13
13
'.json' ,
14
- '.mjs' ,
15
14
'.cjs'
16
15
] ;
17
16
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ compact : true ,
3
+ exclude : [ '**/foo.js' ] ,
4
+ selfDefending : false ,
5
+ sourceMap : true
6
+ } ;
Original file line number Diff line number Diff line change @@ -31,7 +31,29 @@ describe('CLIUtils', () => {
31
31
} ) ;
32
32
} ) ;
33
33
34
- describe ( 'Variant #2: json file with config' , ( ) => {
34
+ describe ( 'Variant #2: cjs file with config' , ( ) => {
35
+ const configDirName : string = 'test/fixtures' ;
36
+ const configFileName : string = 'config.cjs' ;
37
+ const configFilePath : string = `../../../${ configDirName } /${ configFileName } ` ;
38
+ const expectedResult : TInputOptions = {
39
+ compact : true ,
40
+ exclude : [ '**/foo.js' ] ,
41
+ selfDefending : false ,
42
+ sourceMap : true
43
+ } ;
44
+
45
+ let result : Object ;
46
+
47
+ before ( ( ) => {
48
+ result = CLIUtils . getUserConfig ( configFilePath ) ;
49
+ } ) ;
50
+
51
+ it ( 'should return object with user configuration' , ( ) => {
52
+ assert . deepEqual ( result , expectedResult ) ;
53
+ } ) ;
54
+ } ) ;
55
+
56
+ describe ( 'Variant #3: json file with config' , ( ) => {
35
57
const configDirName : string = 'test/fixtures' ;
36
58
const configFileName : string = 'config.json' ;
37
59
const configFilePath : string = `../../../${ configDirName } /${ configFileName } ` ;
You can’t perform that action at this time.
0 commit comments