Skip to content

Commit 4afea5c

Browse files
author
Simon Renoult
committed
test: add missing 'until' test
1 parent 21c307d commit 4afea5c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/lib/statistics.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,32 @@ describe("Statistics", () => {
104104
});
105105
});
106106

107+
context("options.until", () => {
108+
it("returns the appropriate elements", async () => {
109+
// Given
110+
const options: Options = { ...defaultOptions, until: "2010-01-01" };
111+
await new TestRepositoryFixture()
112+
.addFile({ name: "a.js", date: "2000-01-01T00:00:00" })
113+
.addFile({ name: "b.js", date: "2020-01-01T00:00:00" })
114+
.addFile({ name: "c.js", date: "2020-01-01T00:00:00" })
115+
.writeOnDisk();
116+
117+
// When
118+
const result = await Statistics.compute(options);
119+
const statistics = Array.from(result.values());
120+
121+
// Then
122+
expect(statistics).to.deep.equal([
123+
{
124+
churn: 1,
125+
complexity: 1,
126+
path: "a.js",
127+
score: 1,
128+
},
129+
]);
130+
});
131+
});
132+
107133
context("options.sort=score", () => {
108134
it("returns the appropriate elements", async () => {
109135
// Given

0 commit comments

Comments
 (0)