fleet/frontend/utilities/convert_to_csv/convert_to_csv.tests.ts
Martavis Parker 384c987389
Removed all traces of Redux from the app! (#5287)
* clean up routes and useless components

* component clean up

* removed redux from routes

* rename file

* moved useDeepEffect hook with others

* removed redux, fleet, app_constants dirs; added types to utilities

* style cleanup

* typo fix

* removed unused ts-ignore comments

* removed redux packages!!!

* formatting

* fixed typing for simple search function

* updated frontend readme
2022-04-22 09:45:35 -07:00

20 lines
419 B
TypeScript

import convertToCSV from "utilities/convert_to_csv";
const objArray = [
{
first_name: "Mike",
last_name: "Stone",
},
{
first_name: "Paul",
last_name: "Simon",
},
];
describe("convertToCSV - utility", () => {
it("converts an array of objects to CSV format", () => {
expect(convertToCSV(objArray)).toEqual(
'"first_name","last_name"\n"Mike","Stone"\n"Paul","Simon"'
);
});
});