BC-9076 Move documentation to seperate docu repo.#5557
Conversation
|
| constructor(private readonly config: T) {} | ||
|
|
||
| public set(key: K, value: T[K]): void { | ||
| if (Object.prototype.hasOwnProperty.call(this.config, key)) { |
There was a problem hiding this comment.
Is this runtime-check really necessary? Or can we just rely on the type of the config (which basically defines which properties exist)?
Besides that: Wouldn't be this.config.hasOwnProperty() sufficient? Why the additional function binding?
| @@ -0,0 +1,20 @@ | |||
| export class TestConfigHelper<T, K extends keyof T = Extract<keyof T, string>> { | |||
There was a problem hiding this comment.
I'm not sure about the name suffix Helper. Can we just call the class TestConfig?
| export class TestConfigHelper<T, K extends keyof T = Extract<keyof T, string>> { | ||
| private originConfigs = new Map<K, T[K]>(); | ||
|
|
||
| constructor(private readonly config: T) {} |
There was a problem hiding this comment.
As I understand the purpose of this class is to first initialize a test configuration and then later be able to reset it to its initial state? If that's the case wouldn't it be a good idea when we copy the initial config to originalConfig in the constructor? The copy in the set() method is quite hard to understand IMHO.
| @@ -0,0 +1,20 @@ | |||
| export class TestConfigHelper<T, K extends keyof T = Extract<keyof T, string>> { | |||
| private originConfigs = new Map<K, T[K]>(); | |||
There was a problem hiding this comment.
I would suggest to use the singular originalConfig.



Description
Links to Tickets or other pull requests
Approval for review
generate-client:serverwas executed in vue frontend and changes were tested and put in a PR with the same branch name.