Skip to content

Commit 155b35d

Browse files
committed
fix: typescript errors and incorrect tests (using config instead of AppConfig)
1 parent 20fbc88 commit 155b35d

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/adapters/config/AppConfig.test.int.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ describe(`AppConfig`, () => {
1212
it(`config correctly returns proper config`, async () => {
1313
// console.log(`config: ${JSON.stringify(config, null, 2)}`);
1414
// this test relies on devel having appConfig.search.index
15-
const hasIndex = config.has('appConfig.search.index');
15+
const hasIndex = AppConfig.has('appConfig.search.index');
1616
expect(hasIndex).toBeTruthy();
17-
const index = config.get('appConfig.search.index');
17+
const index = AppConfig.get('appConfig.search.index');
1818
// console.log(`info: ${JSON.stringify(info, null, 2)}`)
1919
// expect(index).toBe('fixtures-search-baseline-1008');
20-
expect(config.get('appConfig.search.minServer').length).toBe(1);
20+
expect(AppConfig.get('appConfig.search.minServer')?.length).toBe(1);
2121
});
2222

2323

src/adapters/config/AppConfig.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class AppConfig {
6464
// static getSecret(secretKey:string): string {}
6565

6666

67-
/** sets `"path": "value"` to config, specifically, to `appConfig.path`
67+
/** sets `{"path": "value"}` to config, specifically, to `appConfig.path`
6868
* Note this does not actually change the values in the file, but only in
6969
* the in-memory "cache"
7070
* @param path the path to the key in appConfig. Do not use `{}:.;` in the key name,
@@ -73,7 +73,6 @@ export class AppConfig {
7373
* `appConfig`
7474
*/
7575
static set(path:string, value: string): void {
76-
config.appConfig[path]=value
77-
// AppConfig._sVariables[path] = variable
76+
config['appConfig'][path] = value
7877
}
7978
}

0 commit comments

Comments
 (0)