From 6f886a4a66b7c3667bd08b4fa156a11618a2b6c5 Mon Sep 17 00:00:00 2001 From: Harrison Ifeanyichukwu Date: Tue, 7 May 2019 05:47:11 +0100 Subject: [PATCH] fix: clear lib directory after running test --- src/modules/Bundler.ts | 6 ++++++ tests/index.spec.ts | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/modules/Bundler.ts b/src/modules/Bundler.ts index c5e1d14..7df93b9 100644 --- a/src/modules/Bundler.ts +++ b/src/modules/Bundler.ts @@ -57,6 +57,12 @@ export default class Bundler { }); } + /** + * pick config from target config or global config + * @param prop config property + * @param targetConfig target config + * @param config global config + */ private pickConfig(prop: keyof CommonConfig, targetConfig: LibConfig | DistConfig, config: Config) { if (prop !== 'include' && prop !== 'exclude') { diff --git a/tests/index.spec.ts b/tests/index.spec.ts index c105f67..3076172 100644 --- a/tests/index.spec.ts +++ b/tests/index.spec.ts @@ -1,4 +1,11 @@ import RollupAll from '../src'; +import rimraf from 'rimraf'; +import * as path from 'path'; + +afterEach(function () { + rimraf.sync(path.resolve(__dirname, '../dist')); + rimraf.sync(path.resolve(__dirname, '../lib')); +}); describe('Index', function() {