@@ -19,9 +19,6 @@ describe("config-loader", (): void => {
1919 } ) ;
2020
2121 const successResult = result as ConfigLoaderSuccessResult ;
22- // assert.equal(successResult.resultType, "success");
23- // assert.equal(successResult.absoluteBaseUrl, "/foo/bar");
24- // assert.equal(successResult.paths["asd"][0], "asd");
2522 expect ( successResult . resultType ) . toBe ( "success" ) ;
2623 expect ( successResult . absoluteBaseUrl ) . toBe ( "/foo/bar" ) ;
2724 expect ( successResult . paths [ "asd" ] [ 0 ] ) . toBe ( "asd" ) ;
@@ -39,8 +36,6 @@ describe("config-loader", (): void => {
3936 } ) ;
4037
4138 const successResult = result as ConfigLoaderSuccessResult ;
42- // assert.equal(successResult.resultType, "success");
43- // assert.equal(successResult.absoluteBaseUrl, join("/baz", "bar/"));
4439 expect ( successResult . resultType ) . toBe ( "success" ) ;
4540 expect ( successResult . absoluteBaseUrl ) . toBe ( join ( "/baz" , "bar/" ) ) ;
4641 } ) ;
@@ -49,38 +44,31 @@ describe("config-loader", (): void => {
4944 const result = configLoader ( {
5045 explicitParams : undefined ,
5146 cwd : "/baz" ,
52- // eslint-disable-next-line @typescript-eslint/no-explicit-any
53- tsConfigLoader : ( _ : any ) => ( {
47+ tsConfigLoader : ( ) => ( {
5448 tsConfigPath : "/baz/tsconfig.json" ,
5549 baseUrl : "./src" ,
5650 paths : { } ,
5751 } ) ,
5852 } ) ;
5953
6054 const successResult = result as ConfigLoaderSuccessResult ;
61- // assert.equal(successResult.resultType, "success");
62- // assert.equal(successResult.absoluteBaseUrl, join("/baz", "src"));
6355 expect ( successResult . resultType ) . toBe ( "success" ) ;
6456 expect ( successResult . absoluteBaseUrl ) . toBe ( join ( "/baz" , "src" ) ) ;
6557 } ) ;
6658
67- it ( "should show an error message when baseUrl is missing " , ( ) => {
59+ it ( "should tolerate a missing baseUrl" , ( ) => {
6860 const result = configLoader ( {
6961 explicitParams : undefined ,
7062 cwd : "/baz" ,
71- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72- tsConfigLoader : ( _ : any ) => ( {
63+ tsConfigLoader : ( ) => ( {
7364 tsConfigPath : "/baz/tsconfig.json" ,
7465 baseUrl : undefined ,
7566 paths : { } ,
7667 } ) ,
7768 } ) ;
7869
7970 const failResult = result as ConfigLoaderFailResult ;
80- // assert.equal(failResult.resultType, "failed");
81- // assert.isTrue(failResult.message.indexOf("baseUrl") > -1);
82- expect ( failResult . resultType ) . toBe ( "failed" ) ;
83- expect ( failResult . message . indexOf ( "baseUrl" ) > - 1 ) . toBeTruthy ( ) ;
71+ expect ( failResult . resultType ) . toBe ( "success" ) ;
8472 } ) ;
8573
8674 it ( "should presume cwd to be a tsconfig file when loadConfig is called with absolute path to tsconfig.json" , ( ) => {
@@ -92,8 +80,6 @@ describe("config-loader", (): void => {
9280 const result = loadConfig ( configFile ) ;
9381
9482 const successResult = result as ConfigLoaderSuccessResult ;
95- // assert.equal(successResult.resultType, "success");
96- // assert.equal(successResult.configFileAbsolutePath, configFile);
9783 expect ( successResult . resultType ) . toBe ( "success" ) ;
9884 expect ( successResult . configFileAbsolutePath ) . toBe ( configFile ) ;
9985 } ) ;
@@ -102,15 +88,14 @@ describe("config-loader", (): void => {
10288 const result = configLoader ( {
10389 explicitParams : undefined ,
10490 cwd : "/baz" ,
105- // eslint-disable-next-line @typescript-eslint/no-explicit-any
106- tsConfigLoader : ( _ : any ) => ( {
91+ tsConfigLoader : ( ) => ( {
10792 tsConfigPath : "/baz/tsconfig.json" ,
10893 baseUrl : "/baz" ,
10994 paths : { } ,
11095 } ) ,
11196 } ) ;
11297
11398 const successResult = result as ConfigLoaderSuccessResult ;
114- assert . equal ( successResult . absoluteBaseUrl , "/baz" ) ;
99+ expect ( successResult . absoluteBaseUrl ) . toEqual ( "/baz" ) ;
115100 } ) ;
116101} ) ;
0 commit comments