|
1 | | -import { expect, test, describe } from "bun:test"; |
2 | | -import { isExpVersion } from "./helper"; |
| 1 | +import { describe, expect, test } from 'bun:test'; |
| 2 | +import { isExpVersion } from './helper'; |
3 | 3 |
|
4 | | -describe("isExpVersion", () => { |
5 | | - test("should return false when config is null", () => { |
6 | | - expect(isExpVersion(null, "1.0.0")).toBe(false); |
| 4 | +describe('isExpVersion', () => { |
| 5 | + test('should return false when config is null', () => { |
| 6 | + expect(isExpVersion(null, '1.0.0')).toBe(false); |
7 | 7 | }); |
8 | 8 |
|
9 | | - test("should return false when config is undefined", () => { |
10 | | - expect(isExpVersion(undefined, "1.0.0")).toBe(false); |
| 9 | + test('should return false when config is undefined', () => { |
| 10 | + expect(isExpVersion(undefined, '1.0.0')).toBe(false); |
11 | 11 | }); |
12 | 12 |
|
13 | | - test("should return false when config.rollout is missing", () => { |
14 | | - // @ts-ignore |
15 | | - expect(isExpVersion({}, "1.0.0")).toBe(false); |
| 13 | + test('should return false when config.rollout is missing', () => { |
| 14 | + // @ts-expect-error |
| 15 | + expect(isExpVersion({}, '1.0.0')).toBe(false); |
16 | 16 | }); |
17 | 17 |
|
18 | | - test("should return false when rollout config for version is missing", () => { |
19 | | - expect(isExpVersion({ rollout: {} }, "1.0.0")).toBe(false); |
| 18 | + test('should return false when rollout config for version is missing', () => { |
| 19 | + expect(isExpVersion({ rollout: {} }, '1.0.0')).toBe(false); |
20 | 20 | }); |
21 | 21 |
|
22 | | - test("should return false when rollout config for version is null", () => { |
23 | | - expect(isExpVersion({ rollout: { "1.0.0": null } }, "1.0.0")).toBe(false); |
| 22 | + test('should return false when rollout config for version is null', () => { |
| 23 | + expect(isExpVersion({ rollout: { '1.0.0': null } }, '1.0.0')).toBe(false); |
24 | 24 | }); |
25 | 25 |
|
26 | | - test("should return true when rollout is less than 100", () => { |
27 | | - expect(isExpVersion({ rollout: { "1.0.0": 50 } }, "1.0.0")).toBe(true); |
28 | | - expect(isExpVersion({ rollout: { "1.0.0": 0 } }, "1.0.0")).toBe(true); |
| 26 | + test('should return true when rollout is less than 100', () => { |
| 27 | + expect(isExpVersion({ rollout: { '1.0.0': 50 } }, '1.0.0')).toBe(true); |
| 28 | + expect(isExpVersion({ rollout: { '1.0.0': 0 } }, '1.0.0')).toBe(true); |
29 | 29 | }); |
30 | 30 |
|
31 | | - test("should return false when rollout is 100", () => { |
32 | | - expect(isExpVersion({ rollout: { "1.0.0": 100 } }, "1.0.0")).toBe(false); |
| 31 | + test('should return false when rollout is 100', () => { |
| 32 | + expect(isExpVersion({ rollout: { '1.0.0': 100 } }, '1.0.0')).toBe(false); |
33 | 33 | }); |
34 | 34 |
|
35 | | - test("should return false when rollout is greater than 100", () => { |
36 | | - expect(isExpVersion({ rollout: { "1.0.0": 110 } }, "1.0.0")).toBe(false); |
| 35 | + test('should return false when rollout is greater than 100', () => { |
| 36 | + expect(isExpVersion({ rollout: { '1.0.0': 110 } }, '1.0.0')).toBe(false); |
37 | 37 | }); |
38 | 38 | }); |
0 commit comments