feat(core): initial
This commit is contained in:
3
test/sample.csv
Normal file
3
test/sample.csv
Normal file
@ -0,0 +1,3 @@
|
||||
Header 1;Header 2; Header3
|
||||
row1data1; row1data2; row1data3
|
||||
row2data1; row2data2; row2data3
|
|
21
test/test.ts
Normal file
21
test/test.ts
Normal file
@ -0,0 +1,21 @@
|
||||
// tslint:disable-next-line:no-implicit-dependencies
|
||||
import { expect, tap } from 'tapbundle';
|
||||
import * as smartcsv from '../ts/index';
|
||||
|
||||
// tslint:disable-next-line:no-implicit-dependencies
|
||||
import * as smartfile from 'smartfile';
|
||||
|
||||
let fileString: string;
|
||||
let testCsv: smartcsv.Csv;
|
||||
|
||||
tap.test('should read a file', async (tools) => {
|
||||
fileString = smartfile.fs.toStringSync('./test/sample.csv');
|
||||
});
|
||||
|
||||
tap.test('should create a valid csv', async () => {
|
||||
testCsv = await smartcsv.Csv.createCsvFromString(fileString, {headers: true});
|
||||
const result = await testCsv.exportAsObject();
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user