feature-flags.util.spec.js 1013 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const feature_flags_util_1 = require("./feature-flags.util");
  4. describe('FeatureFlagUtil', () => {
  5. describe('prepareBooleanStringFeatureFlag', () => {
  6. it('should return default value when value is undefined', () => {
  7. expect((0, feature_flags_util_1.prepareBooleanStringFeatureFlag)(undefined, true)).toEqual(true);
  8. });
  9. it('should return default value when value is empty string', () => {
  10. expect((0, feature_flags_util_1.prepareBooleanStringFeatureFlag)('', true)).toEqual(true);
  11. });
  12. it('should return true when provided value is true', () => {
  13. expect((0, feature_flags_util_1.prepareBooleanStringFeatureFlag)('false', true)).toEqual(false);
  14. });
  15. it('should return false when provided value is false', () => {
  16. expect((0, feature_flags_util_1.prepareBooleanStringFeatureFlag)('false', true)).toEqual(false);
  17. });
  18. });
  19. });