From 445eaa1cc9d1d7835855cac907daaf6a092f9322 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Fri, 10 Dec 2021 18:19:37 -0500 Subject: [PATCH] Add iowa-electricity test for CSV loading --- src/lib/runtime.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib/runtime.test.ts b/src/lib/runtime.test.ts index 09ba70f..629dfe9 100644 --- a/src/lib/runtime.test.ts +++ b/src/lib/runtime.test.ts @@ -225,7 +225,7 @@ describe("promise cancellation", () => { }); describe("import directives", () => { - it("can load vega-datasets/crimea", async () => { + it("can load crimea.json", async () => { await init(); await checkProgram({ src: `import crimea from "npm://vega-datasets@2.1.0/data/crimea.json"`, @@ -262,6 +262,22 @@ describe("import directives", () => { }, }); }); + + it("can load iowa-electricity.csv", async () => { + await init(); + await checkProgram({ + src: ` +import iowa from "npm://vega-datasets@2.1.0/data/iowa-electricity.csv" +count(value: count[1] { iowa() }). +`, + deps: [], + results: ["iowa", "count"], + input: {}, + output: { + count: [{ value: 51 }], + }, + }); + }); }); describe("aggregation operators", () => {