Skip to content

Commit

Permalink
[BUGS] Unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eksant committed Aug 4, 2019
1 parent 3ef7dae commit 794a00a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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}`);
});
Expand Down

0 comments on commit 794a00a

Please sign in to comment.