Files
Automata/packages/@n8n/config/test/decorators.test.ts
कारतोफ्फेलस्क्रिप्ट™ 70b410f4b0 fix(core): Make boolean config value parsing backward-compatible (#10560)
2024-08-27 13:51:26 +02:00

22 lines
510 B
TypeScript

import { Container } from 'typedi';
import { Config, Env } from '../src/decorators';
describe('decorators', () => {
beforeEach(() => {
Container.reset();
});
it('should throw when explicit typing is missing', () => {
expect(() => {
@Config
class InvalidConfig {
@Env('STRING_VALUE')
value = 'string';
}
Container.get(InvalidConfig);
}).toThrowError(
'Invalid decorator metadata on key "value" on InvalidConfig\n Please use explicit typing on all config fields',
);
});
});