You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
341 B

5 years ago
  1. import CSVParser from '@/services/parsers/csv.service'
  2. describe('Request', () => {
  3. const parser = new CSVParser()
  4. test('can parse text', () => {
  5. const text = 'col 1,col 2\n1,2'
  6. const parsed = parser.parse(text)
  7. expect(parsed.meta.fields).toEqual(['col 1', 'col 2'])
  8. expect(parsed.data[0]['col 1']).toEqual('1')
  9. })
  10. })