Add more and unify tests for absent object cases
- Unify test data for nonexistence of an object/string and collection. - Introduce more test through adding missing test data to existing tests. - Improve logic for checking absence of values to match tests. - Add missing tests for absent value validation. - Update documentation to include shared test functionality.
This commit is contained in:
@@ -27,12 +27,12 @@ export class ApplicationContext implements IApplicationContext {
|
||||
initialContext: OperatingSystem,
|
||||
) {
|
||||
validateApp(app);
|
||||
assertInRange(initialContext, OperatingSystem);
|
||||
this.states = initializeStates(app);
|
||||
this.changeContext(initialContext);
|
||||
}
|
||||
|
||||
public changeContext(os: OperatingSystem): void {
|
||||
assertInRange(os, OperatingSystem);
|
||||
if (this.currentOs === os) {
|
||||
return;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export class ApplicationContext implements IApplicationContext {
|
||||
|
||||
function validateApp(app: IApplication) {
|
||||
if (!app) {
|
||||
throw new Error('undefined app');
|
||||
throw new Error('missing app');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user