mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 00:18:27 +00:00
* 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
20 lines
419 B
TypeScript
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"'
|
|
);
|
|
});
|
|
});
|