From c6b6e65b38de58969a77068493699359846ec0a5 Mon Sep 17 00:00:00 2001 From: "Sean.Mars" Date: Sun, 31 Jul 2016 12:20:40 +0800 Subject: [PATCH] - add mocha.opts --- test/mocha.opts | 3 +++ test/test.js | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 test/mocha.opts diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..7a574fd --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,3 @@ +--timeout 500000 +--require should +--ui bdd diff --git a/test/test.js b/test/test.js index 7f8d81b..d692a5f 100644 --- a/test/test.js +++ b/test/test.js @@ -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(); }); }); });