@teselagen/range-utils 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -1,35 +1,35 @@
|
|
1
|
-
import trimAnnStartEndToFitSeqLength from
|
1
|
+
import trimAnnStartEndToFitSeqLength from "./trimAnnStartEndToFitSeqLength";
|
2
2
|
|
3
|
-
describe(
|
4
|
-
test(
|
3
|
+
describe("trimAnnStartEndToFitSeqLength", () => {
|
4
|
+
test("should return 0 if annStartOrEnd is undefined", () => {
|
5
5
|
expect(trimAnnStartEndToFitSeqLength(undefined, 10)).toBe(0);
|
6
6
|
});
|
7
7
|
|
8
|
-
test(
|
8
|
+
test("should return 0 if annStartOrEnd is null", () => {
|
9
9
|
expect(trimAnnStartEndToFitSeqLength(null, 10)).toBe(0);
|
10
10
|
});
|
11
11
|
|
12
|
-
test(
|
12
|
+
test("should return 0 if annStartOrEnd is less than 0", () => {
|
13
13
|
expect(trimAnnStartEndToFitSeqLength(-5, 10)).toBe(0);
|
14
14
|
});
|
15
15
|
|
16
|
-
test(
|
16
|
+
test("should return annStartOrEnd if it is within the sequence length", () => {
|
17
17
|
expect(trimAnnStartEndToFitSeqLength(5, 10)).toBe(5);
|
18
18
|
});
|
19
19
|
|
20
|
-
test(
|
20
|
+
test("should return sequenceLength - 1 if annStartOrEnd is greater than sequenceLength", () => {
|
21
21
|
expect(trimAnnStartEndToFitSeqLength(15, 10)).toBe(9);
|
22
22
|
});
|
23
23
|
|
24
|
-
test(
|
24
|
+
test("should return 0 if sequenceLength is 0", () => {
|
25
25
|
expect(trimAnnStartEndToFitSeqLength(5, 0)).toBe(0);
|
26
26
|
});
|
27
27
|
|
28
|
-
test(
|
28
|
+
test("should return 0 if sequenceLength is negative", () => {
|
29
29
|
expect(trimAnnStartEndToFitSeqLength(5, -10)).toBe(0);
|
30
30
|
});
|
31
31
|
|
32
|
-
test(
|
32
|
+
test("should return 0 if annStartOrEnd is 0", () => {
|
33
33
|
expect(trimAnnStartEndToFitSeqLength(0, 10)).toBe(0);
|
34
34
|
});
|
35
35
|
});
|