Skip to content

Commit

Permalink
ci: Propagate test errors, part1
Browse files Browse the repository at this point in the history
  • Loading branch information
q2s2t committed Nov 2, 2018
1 parent d4dc90d commit ff7b850
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:

- run:
name: Run tests and coverage
command: npm run coverage
command: |
set -e
npm run coverage
- run:
name: Send coverage to Code Climate
Expand Down
32 changes: 16 additions & 16 deletions test/func/list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ describe('Functional: list()', function () {
const seven = list(archive, '*.txt', { r: true })
const data = []
const expectedData = [
{ datetime: new Date('2018-10-13T09:29:26.000Z'),
attributes: '....A',
size: 9,
sizeCompressed: undefined,
file: 'DirExt/root.txt' },
{ datetime: new Date('2018-10-13T09:28:52.000Z'),
attributes: '....A',
size: 9,
sizeCompressed: undefined,
file: 'DirExt/sub1/sub1.txt' },
{ datetime: new Date('2018-10-13T09:29:39.000Z'),
attributes: '....A',
size: 9,
sizeCompressed: undefined,
file: 'DirExt/sub2/sub2.txt' }
{ attributes: '....A', size: 9, sizeCompressed: undefined, file: 'DirExt/root.txt' },
{ attributes: '....A', size: 9, sizeCompressed: undefined, file: 'DirExt/sub1/sub1.txt' },
{ attributes: '....A', size: 9, sizeCompressed: undefined, file: 'DirExt/sub2/sub2.txt' }
]
seven.on('data', d => data.push(d))
seven.on('end', function () {
expect(data).to.deep.equal(expectedData)
const withoutDatetime = data
.map(function (d) {
const { datetime, ...rest } = d
return rest
})
const dates = data.map(d => d.datetime)
for (let d of dates) {
expect(d).to.be.a('date')
}
expect(withoutDatetime).to.deep.contain(expectedData[0])
expect(withoutDatetime).to.deep.contain(expectedData[1])
expect(withoutDatetime).to.deep.contain(expectedData[2])
expect(data.length).to.equal(3)
done()
})
})
Expand Down

0 comments on commit ff7b850

Please sign in to comment.