renovate/lib/modules/manager/terraform/util.spec.ts
2022-04-12 14:49:49 +00:00

42 lines
1.3 KiB
TypeScript

import { TerraformDependencyTypes } from './common';
import { getTerraformDependencyType } from './util';
describe('modules/manager/terraform/util', () => {
describe('getTerraformDependencyType()', () => {
it('returns TerraformDependencyTypes.module', () => {
expect(getTerraformDependencyType('module')).toBe(
TerraformDependencyTypes.module
);
});
it('returns TerraformDependencyTypes.provider', () => {
expect(getTerraformDependencyType('provider')).toBe(
TerraformDependencyTypes.provider
);
});
it('returns TerraformDependencyTypes.unknown', () => {
expect(getTerraformDependencyType('unknown')).toBe(
TerraformDependencyTypes.unknown
);
});
it('returns TerraformDependencyTypes.required_providers', () => {
expect(getTerraformDependencyType('required_providers')).toBe(
TerraformDependencyTypes.required_providers
);
});
it('returns TerraformDependencyTypes.unknown on empty string', () => {
expect(getTerraformDependencyType('')).toBe(
TerraformDependencyTypes.unknown
);
});
it('returns TerraformDependencyTypes.unknown on string with random chars', () => {
expect(getTerraformDependencyType('sdfsgdsfadfhfghfhgdfsdf')).toBe(
TerraformDependencyTypes.unknown
);
});
});
});