-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating tests that show nulls not working!
Run this with `deno task test`
- Loading branch information
1 parent
e564b81
commit a4900b0
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { assertEquals } from "jsr:@std/assert"; | ||
import { duckDbLoader } from "jsr:@dringtech/[email protected]"; | ||
|
||
Deno.test('nulls should be returned for householdProjections', async () => { | ||
const loader = duckDbLoader(); | ||
const dataItem = await loader('src/data/areas/place-page/_data/householdProjections.sql'); | ||
console.log(`${dataItem}`); | ||
let res = dataItem('E06000028').find(x => x.date === 2023)!; | ||
console.log(res); | ||
assertEquals(res.HouseholdProjection, 86936); | ||
assertEquals(res.AllVacants, null); | ||
assertEquals(res.Dwellings, null); | ||
assertEquals(res.LongTermVacants, null); | ||
|
||
res = dataItem('E06000028').find(x => x.date === 2023)!; | ||
console.log(res); | ||
assertEquals(res.HouseholdProjection, 86936); | ||
assertEquals(res.AllVacants, null); | ||
assertEquals(res.Dwellings, null); | ||
assertEquals(res.LongTermVacants, null); | ||
}) | ||
|
||
Deno.test('nulls should be returned for householdProjections', async () => { | ||
const loader = duckDbLoader(); | ||
const dataItem = await loader('src/data/hexmaps/_data/housepriceratio.sql'); | ||
console.log(`${dataItem}`); | ||
let res = dataItem(); | ||
assertEquals(res.find(x => x.geography_code === 'E09000001')!.value, null); | ||
assertEquals(res.find(x => x.geography_code === 'E06000053')!.value, null); | ||
|
||
res = dataItem(); | ||
assertEquals(res.find(x => x.geography_code === 'E09000001')!.value, null); | ||
assertEquals(res.find(x => x.geography_code === 'E06000053')!.value, null); | ||
}) |