Skip to content

Commit

Permalink
fix: support boolean default (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzraho committed Nov 10, 2023
1 parent 8563ff5 commit f187e86
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion schema/app.config.yaml.schema.json
Expand Up @@ -228,7 +228,7 @@
"additionalProperties": false
}
},
"configSchemaValue": { "type": "string", "maxLength": 1000 },
"configSchemaValue": { "type": ["string", "boolean"], "maxLength": 1000 },
"productDependencies": {
"type": "array",
"items": {
Expand Down
26 changes: 26 additions & 0 deletions test/index.test.js
Expand Up @@ -580,6 +580,32 @@ application:
}))
})

test('default boolean = true', async () => {
global.fakeFileSystem.addJson(
{
'/package.json': '{}',
'/app.config.yaml': `
application:
runtimeManifest: { packages: {}}
configSchema:
properties:
- envKey: BYE
type: boolean
default: true
`
}
)
await expect(appConfig.load({})).resolves.toEqual(expect.objectContaining({
configSchema: {
properties: [{
envKey: 'BYE',
type: 'boolean',
default: true
}]
}
}))
})

test('valid no configSchema', async () => {
global.fakeFileSystem.addJson(
{
Expand Down

0 comments on commit f187e86

Please sign in to comment.