Skip to content

Commit ed64c84

Browse files
committed
Dont throw error for unused keys in toml while in local mode
1 parent 837def6 commit ed64c84

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

packages/app/src/cli/models/app/loader.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,6 +2723,36 @@ redirect_urls = [ "https://example.com/api/auth" ]
27232723
'Unsupported section(s) in app configuration: and_another, something_else',
27242724
)
27252725
})
2726+
2727+
test('does not throw unsupported config property error when mode is local', async () => {
2728+
const linkedAppConfigurationWithExtraConfig = `
2729+
name = "for-testing"
2730+
client_id = "1234567890"
2731+
application_url = "https://example.com/lala"
2732+
embedded = true
2733+
2734+
[build]
2735+
include_config_on_deploy = true
2736+
2737+
[webhooks]
2738+
api_version = "2023-07"
2739+
2740+
[auth]
2741+
redirect_urls = [ "https://example.com/api/auth" ]
2742+
2743+
[something_else]
2744+
not_valid = true
2745+
2746+
[and_another]
2747+
bad = true
2748+
`
2749+
await writeConfig(linkedAppConfigurationWithExtraConfig)
2750+
2751+
const app = await loadTestingApp({mode: 'local'})
2752+
2753+
expect(app).toBeDefined()
2754+
expect(app.name).toBe('for-testing')
2755+
})
27262756
})
27272757

27282758
describe('getAppConfigurationFileName', () => {

packages/app/src/cli/models/app/loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ class AppLoader<TConfig extends AppConfiguration, TModuleSpec extends ExtensionS
682682
return !configKeysThatAreNeverModules.includes(key)
683683
})
684684

685-
if (unusedKeys.length > 0) {
685+
if (unusedKeys.length > 0 && this.mode !== 'local') {
686686
this.abortOrReport(
687687
outputContent`Unsupported section(s) in app configuration: ${unusedKeys.sort().join(', ')}`,
688688
undefined,

0 commit comments

Comments
 (0)