Add basic tests

This commit is contained in:
Adria Navarro 2023-05-02 10:44:25 +01:00
parent 29df12c247
commit c87cc39cea
1 changed files with 16 additions and 0 deletions

View File

@ -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" },
])
})
})
})