Skip to content

Commit 22d119c

Browse files
committed
Add test for skipping empty cells when finding header
1 parent cb44476 commit 22d119c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

test/example_empty_cells.xlsx

11 KB
Binary file not shown.

test/test_files.js

+13
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,17 @@ describe('files', () => {
131131
done()
132132
})
133133
})
134+
it("ignores empty cells when finding header", done => {
135+
fs.readFile(path.join(__dirname, 'example_empty_cells.xlsx'), (err, content) => {
136+
const {lines} = oneClickBOM.parse(content)
137+
expect(lines.length).to.be.above(0)
138+
const buf = oneClickBOM.write(lines, {type: 'buffer', bookType: 'csv'})
139+
const r = oneClickBOM.parse(buf)
140+
const lines2 = r.lines
141+
const tsv1 = oneClickBOM.writeTSV(lines)
142+
const tsv2 = oneClickBOM.writeTSV(lines2)
143+
expect(tsv1).to.equal(tsv2)
144+
done()
145+
})
146+
})
134147
})

0 commit comments

Comments
 (0)