Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
- add mocha.opts
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmars committed Jul 31, 2016
1 parent 0cd61fd commit c6b6e65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--timeout 500000
--require should
--ui bdd
20 changes: 15 additions & 5 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,47 @@ describe('Load file', function () {
describe('#loadSheet()', function () {
describe('when type is xlsx', function () {
describe('when file is NOT exist', function () {
it('should throw expect', function () {
it('should throw expect', function (done) {
var filePath = './test/data/none.xlsx';
should.throws(() => e2jt.loadSheet(filePath, 'test'));

return done();
});
});

describe('when sheet is exist', function () {
it('should return undefined', function () {
it('should return undefined', function (done) {
var sheet = e2jt.loadSheet('./test/data/test.xlsx', 'none');
should(sheet).not.ok();

return done();
});
});

describe('when sheet is NOT exist', function () {
it('should return sheet object', function () {
it('should return sheet object', function (done) {
var sheet = e2jt.loadSheet('./test/data/test.xlsx', 'test');
should(sheet).ok();

return done();
});
});

describe('without parameter [filePath] and [sheetName]', function () {
it('should return undefined', function () {
it('should return undefined', function (done) {
var sheet = e2jt.loadSheet();
should(sheet).not.ok();

return done();
});
});

describe('without parameter [sheetName]', function () {
it('should return undefined', function () {
it('should return undefined', function (done) {
var sheet = e2jt.loadSheet('./test/data/test.xlsx');
should(sheet).not.ok();

return done();
});
});
});
Expand Down

0 comments on commit c6b6e65

Please sign in to comment.