Skip to content

Commit

Permalink
this test should fail
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 15, 2024
1 parent 5754fe4 commit 5829d7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@n8n/config/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export const Config: ClassDecorator = (ConfigClass: Class) => {
} else {
value = value === 'true';
}
} else if (type === Object) {
// eslint-disable-next-line n8n-local-rules/no-plain-errors
throw new Error(
`Invalid decorator metadata on key "${key as string}" on ${ConfigClass.name}\n Please use explicit typing on all config fields`,
);
} else if (type !== String && type !== Object) {
value = new (type as Constructable)(value as string);
}
Expand Down
1 change: 1 addition & 0 deletions packages/@n8n/config/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ describe('GlobalConfig', () => {
DB_POSTGRESDB_USER: 'n8n',
DB_TABLE_PREFIX: 'test_',
NODES_INCLUDE: '["n8n-nodes-base.hackerNews"]',
DB_LOGGING_MAX_EXECUTION_TIME: '0',
};
const config = Container.get(GlobalConfig);
expect(config).toEqual({
Expand Down

0 comments on commit 5829d7d

Please sign in to comment.