Add basic tests
This commit is contained in:
parent
29df12c247
commit
c87cc39cea
|
@ -0,0 +1,16 @@
|
||||||
|
import { jsonFromCsvString } from "../csv"
|
||||||
|
|
||||||
|
describe("csv", () => {
|
||||||
|
describe("jsonFromCsvString", () => {
|
||||||
|
test("multiple lines csv can be casted", async () => {
|
||||||
|
const csvString = '"id","title"\n"1","aaa"\n"2","bbb"'
|
||||||
|
|
||||||
|
const result = await jsonFromCsvString(csvString)
|
||||||
|
|
||||||
|
expect(result).toEqual([
|
||||||
|
{ id: "1", title: "aaa" },
|
||||||
|
{ id: "2", title: "bbb" },
|
||||||
|
])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue