|
1 | 1 | import { expect, test } from "bun:test";
|
2 |
| -// import * as transducers-stats from "../src/index.js" |
| 2 | +import { donchian, movingMaximum, movingMinimum } from "../src/index.js"; |
3 | 3 |
|
4 |
| -test.todo("transducers-stats", () => {}); |
| 4 | +test("movingMaxium", () => { |
| 5 | + expect([...movingMaximum(3, [1, 3, 1, 1, 4, 1, 1, 2, 5, 6])]).toEqual([ |
| 6 | + 3, 3, 4, 4, 4, 2, 5, 6, |
| 7 | + ]); |
| 8 | +}); |
| 9 | + |
| 10 | +test("movingMinium", () => { |
| 11 | + expect([...movingMinimum(3, [1, 3, 1, 1, 4, 1, 1, 2, 5, 6])]).toEqual([ |
| 12 | + 1, 1, 1, 1, 1, 1, 1, 2, |
| 13 | + ]); |
| 14 | +}); |
| 15 | + |
| 16 | +test("donchian", () => { |
| 17 | + expect([...donchian(3, [1, 3, 1, 1, 4, 1, 1, 2, 5, 6])]).toEqual([ |
| 18 | + [1, 3], |
| 19 | + [1, 3], |
| 20 | + [1, 4], |
| 21 | + [1, 4], |
| 22 | + [1, 4], |
| 23 | + [1, 2], |
| 24 | + [1, 5], |
| 25 | + [2, 6], |
| 26 | + ]); |
| 27 | +}); |
0 commit comments