Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should return false for negate values', () => {
expect(isFeatureLevel(config, '!1.2')).toBeFalsy();
expect(isFeatureLevel(config, '!1.3')).toBeFalsy();
expect(isFeatureLevel(config, '!1.5')).toBeTruthy();
});
});
it('should return true for equal levels', () => {
expect(isFeatureLevel(config, '1.3')).toBeTruthy();
expect(isFeatureLevel(config, '1.3.0')).toBeTruthy();
});
it('should return false for higher levels', () => {
it('should return true for lower levels', () => {
expect(isFeatureLevel(config, '1.0')).toBeTruthy();
expect(isFeatureLevel(config, '1.02')).toBeTruthy();
expect(isFeatureLevel(config, '1.2.9')).toBeTruthy();
});
it('should return true for equal levels', () => {
it('should return false for higher levels', () => {
expect(isFeatureLevel(config, '1.5')).toBeFalsy();
expect(isFeatureLevel(config, '2.0')).toBeFalsy();
expect(isFeatureLevel(config, '1.3.1')).toBeFalsy();
expect(isFeatureLevel(config, '1.20')).toBeFalsy();
});
it('should return false for negate values', () => {
it('should return true for lower levels', () => {
expect(isFeatureLevel(config, '1.0')).toBeTruthy();
expect(isFeatureLevel(config, '1.02')).toBeTruthy();
expect(isFeatureLevel(config, '1.2.9')).toBeTruthy();
});
it('should return true for equal levels', () => {
it('should return false for negate values', () => {
expect(isFeatureLevel(config, '!1.2')).toBeFalsy();
expect(isFeatureLevel(config, '!1.3')).toBeFalsy();
expect(isFeatureLevel(config, '!1.5')).toBeTruthy();
});
});
it('should return correct value if feature level is set to * (latest)', () => {
const config: FeaturesConfig = {
features: {
level: '*',
},
};
expect(isFeatureLevel(config, '1.2')).toBeTruthy();
expect(isFeatureLevel(config, '2.0')).toBeTruthy();
});
});
it('should return correct value if feature level is set to * (latest)', () => {
const config: FeaturesConfig = {
features: {
level: '*',
},
};
expect(isFeatureLevel(config, '1.2')).toBeTruthy();
expect(isFeatureLevel(config, '2.0')).toBeTruthy();
});
});
it('should return false for negate values', () => {
expect(isFeatureLevel(config, '!1.2')).toBeFalsy();
expect(isFeatureLevel(config, '!1.3')).toBeFalsy();
expect(isFeatureLevel(config, '!1.5')).toBeTruthy();
});
});
it('should return false for higher levels', () => {
expect(isFeatureLevel(config, '1.5')).toBeFalsy();
expect(isFeatureLevel(config, '2.0')).toBeFalsy();
expect(isFeatureLevel(config, '1.3.1')).toBeFalsy();
expect(isFeatureLevel(config, '1.20')).toBeFalsy();
});
it('should return false for negate values', () => {