mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 03:18:12 +08:00
TS typing for Dataframe (#2382)
* initial TS typing * first cut at Dataframe TS typing * more Dataframe typing * comments * more Dataframe cleanup * PR review fixes and improvements
This commit is contained in:
@@ -188,8 +188,10 @@ describe("AnnoMatrix", () => {
|
||||
(fetch as any)
|
||||
.once(serverMocks.annotationsObs(["n_genes"]))
|
||||
.once(serverMocks.annotationsObs(["n_genes"]));
|
||||
const ng1 = await am1.fetch("obs", "n_genes");
|
||||
const ng2 = await am2.fetch("obs", "n_genes");
|
||||
const ng1 = (await am1.fetch("obs", "n_genes")) as Dataframe;
|
||||
const ng2 = (await am2.fetch("obs", "n_genes")) as Dataframe;
|
||||
expect(ng1).toBeDefined();
|
||||
expect(ng2).toBeDefined();
|
||||
expect(ng1).toHaveLength(ng2.length);
|
||||
expect(ng1.colIndex.labels()).toEqual(ng2.colIndex.labels());
|
||||
expect(ng1.col("n_genes").asArray()).toEqual(
|
||||
@@ -216,7 +218,7 @@ describe("AnnoMatrix", () => {
|
||||
);
|
||||
expect(base.getMatrixColumns("obs")).not.toContain("foo");
|
||||
expect(am1.getMatrixColumns("obs")).toContain("foo");
|
||||
const foo = await am1.fetch("obs", "foo");
|
||||
const foo: Dataframe = await am1.fetch("obs", "foo");
|
||||
expect(foo).toBeDefined();
|
||||
expect(foo).toBeInstanceOf(Dataframe);
|
||||
expect(foo).toHaveLength(am1.nObs);
|
||||
|
||||
Reference in New Issue
Block a user