Skip to content

Commit 3dd1055

Browse files
committed
Example csv with BOM + failing test case
1 parent 4abb003 commit 3dd1055

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/modules/CSVModule.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ const exampleResponse = require('./fixtures/csv-response.json');
44

55
const INVALID_MRN = 'INVALID MRN';
66
const csvModule = new CSVModule(path.join(__dirname, './fixtures/example-csv.csv'));
7+
const csvModuleWithBOMs = new CSVModule(path.join(__dirname, './fixtures/example-csv-bom.csv'));
78

89
test('Reads data from CSV', async () => {
910
const data = await csvModule.get('mrn', 'example-mrn-1');
1011
expect(data).toEqual(exampleResponse);
1112
});
1213

14+
test('Reads data from CSV with a Byte Order Mark', async () => {
15+
const data = await csvModuleWithBOMs.get('mrn', 'example-mrn-1');
16+
expect(data).toEqual(exampleResponse);
17+
});
18+
1319
test('Returns multiple rows', async () => {
1420
const data = await csvModule.get('mrn', 'example-mrn-2');
1521
expect(data).toHaveLength(2);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mrn,trialSubjectID,enrollmentStatus,trialResearchID,trialStatus,dateRecorded
2+
example-mrn-1,subjectId-1,status-1,researchId-1,trialStatus-1,2020-01-10
3+
example-mrn-2,subjectId-2,status-2,researchId-2,trialStatus-2,2020-01-10
4+
example-mrn-2,subjectId-3,status-3,researchId-3,trialStatus-3,2020-06-10

0 commit comments

Comments
 (0)