-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbigint.spec.ts
31 lines (25 loc) · 987 Bytes
/
bigint.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { resolve } from "path";
import { readFileSync } from "fs";
import MDBReader from "../src/index.js";
import forEach from "mocha-each";
import { expect } from "chai";
describe("BigInt", () => {
forEach([["V2016/bigint.accdb"]]).describe("%s", (filename) => {
const path = resolve("test/data", filename);
let buffer: Buffer;
beforeEach(() => {
buffer = readFileSync(path);
});
/**
* @see https://github.com/jahlborn/jackcess/blob/3f75e95a21d9a9e3486519511cdd6178e3c2e3e4/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java#L471-L516
*/
it("getData(): returns correct big int data", () => {
const reader = new MDBReader(buffer);
const table = reader.getTable("Table");
const rows = table.getData();
expect(rows.length).to.eq(1);
const row = rows[0]!;
expect(row['Numeric']).to.eq(42n);
});
});
});