Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mudrekh committed Feb 15, 2020
1 parent c4421a5 commit 125a563
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -32,6 +32,7 @@
"homepage": "https://github.com/Mudrekh/qsort-async#readme",
"devDependencies": {
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.9",
"eslint": "^5.16.0",
"eslint-plugin-chai-friendly": "^0.4.1",
Expand Down
11 changes: 10 additions & 1 deletion test/quicksort.spec.js
@@ -1,4 +1,6 @@
require('chai').should();
const chai = require('chai');
chai.should();
chai.use(require('chai-as-promised'));

const quicksort = require('../index.js');
describe('quicksort', () => {
Expand Down Expand Up @@ -29,6 +31,13 @@ describe('quicksort', () => {
// See we yield
times.should.have.length.above(10);
}).timeout(10000);
it('should sort an empty array', () => quicksort([], (one, two) => one - two));
it('should throw when not given an array', async () => {
await quicksort('asdfasd').should.eventually.be.rejectedWith(TypeError);
});
it('should throw when not given a a function', async () => {
await quicksort([], 'asdfasdfsda').should.eventually.be.rejectedWith(TypeError);
});
});

describe('default sort', () => {
Expand Down

0 comments on commit 125a563

Please sign in to comment.