From 794a00a5f89442dda09ffb80f84cfd88b25ad596 Mon Sep 17 00:00:00 2001 From: eksant Date: Sun, 4 Aug 2019 15:00:59 +0800 Subject: [PATCH] [BUGS] Unit testing --- test/actions.test.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/actions.test.js b/test/actions.test.js index 4a298eb..1359b9b 100644 --- a/test/actions.test.js +++ b/test/actions.test.js @@ -3,24 +3,24 @@ const lignator = require('lignator'); const assert = require('chai').assert; const expect = require('chai').expect; +const expPath = 'express'; const actions = require('../bin/actions'); -const init = async path => { - if (await fs.existsSync(path)) { - await lignator.remove(path); +const init = async () => { + if (await fs.existsSync(expPath)) { + await lignator.remove(expPath); } - await actions.init(path); + await actions.init(expPath); }; -const clean = async path => { - if (await fs.existsSync(path)) { - await lignator.remove(path); +const clean = async () => { + if (await fs.existsSync(expPath)) { + await lignator.remove(expPath); } }; -const expPath = 'express'; -init(expPath); - +init(); require('chai').use(require('chai-fs')); + describe('Global-Express Actions Init Testing :', () => { it(`should create folder ${expPath} if it does not exist`, async () => { await expect(`${expPath}`).to.be.a.directory(); @@ -100,7 +100,7 @@ describe('Global-Express Actions Init Testing :', () => { describe('Global Express Actions Clean Testing :', () => { it(`should delete folder ${expPath} if it exist`, async () => { - await clean(expPath); + await clean(); await expect(`${expPath}`).to.not.be.a.path(); await assert.notPathExists(`${expPath}`); });