Skip to content

Commit 8fb1258

Browse files
authored
chore: Fixed test for map declaration type (#1282)
* Fixed test for map declaration with foreign default value
1 parent 829f147 commit 8fb1258

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/utils/options/options.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Logger, Options, ParameterType, ParameterScope } from '../../../lib/utils';
2-
import { NumberDeclarationOption } from '../../../lib/utils/options';
2+
import { MapDeclarationOption, NumberDeclarationOption } from '../../../lib/utils/options';
33
import { deepStrictEqual as equal, throws } from 'assert';
44
import { DeclarationOption } from '../../../lib/utils/options';
55

@@ -91,9 +91,8 @@ describe('Options', () => {
9191
options.removeDeclarationByName(declaration.name);
9292
});
9393

94-
it('Does not error if a map declaration has a default value that is not part of the map of possible values', () => {
95-
logger.resetErrors();
96-
options.addDeclaration({
94+
it('Does not throw if a map declaration has a default value that is not part of the map of possible values', () => {
95+
const declaration: MapDeclarationOption<number> = {
9796
name: 'testMapDeclarationWithForeignDefaultValue',
9897
help: '',
9998
type: ParameterType.Map,
@@ -102,8 +101,9 @@ describe('Options', () => {
102101
['b', 2]
103102
]),
104103
defaultValue: 0
105-
});
106-
equal(logger.hasErrors(), false);
104+
};
105+
options.addDeclaration(declaration);
106+
options.removeDeclarationByName(declaration.name);
107107
});
108108

109109
it('Supports removing a declaration by name', () => {

0 commit comments

Comments
 (0)