Skip to content

Commit 49e8ff4

Browse files
committed
test(exchange): drop parameter property for erasableSyntaxOnly
The test's `constructor(private readonly dataset)` is a parameter property, which emits runtime code and is rejected by CI's `erasableSyntaxOnly` lint:types (TS1294). Use an explicit #dataset private field instead.
1 parent 38ad815 commit 49e8ff4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/exchange/src/broker/MarketDataSource.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,22 @@ function buildDataset(length: number, spacingInMillis: number): Candle[] {
3434
*/
3535
class TestMarketDataSource extends MarketDataSource {
3636
readonly windows: {startInMillis: number; endInMillis: number}[] = [];
37+
readonly #dataset: Candle[];
3738

38-
constructor(private readonly dataset: Candle[]) {
39+
constructor(dataset: Candle[]) {
3940
super();
41+
this.#dataset = dataset;
4042
}
4143

4244
async getCandles(_pair: TradingPair, request: CandleImportRequest): Promise<Candle[]> {
4345
const startInMillis = new Date(request.startTimeFirstCandle).getTime();
4446
const endInMillis = new Date(request.startTimeLastCandle).getTime();
4547
this.windows.push({endInMillis, startInMillis});
46-
return this.dataset.filter(c => c.openTimeInMillis >= startInMillis && c.openTimeInMillis <= endInMillis);
48+
return this.#dataset.filter(c => c.openTimeInMillis >= startInMillis && c.openTimeInMillis <= endInMillis);
4749
}
4850

4951
async getLatestCandle(): Promise<Candle> {
50-
return this.dataset[this.dataset.length - 1];
52+
return this.#dataset[this.#dataset.length - 1];
5153
}
5254

5355
async watchCandles() {

0 commit comments

Comments
 (0)