From 9299921ee962f560e9889f6764905907176ce952 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Aug 2016 11:55:37 -0700 Subject: [PATCH] Delete output lib folder before instrumenting --- spec/coverage/instrument.js | 3 +++ spec/package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/spec/coverage/instrument.js b/spec/coverage/instrument.js index 566b53acf7c8..aad98a85798d 100644 --- a/spec/coverage/instrument.js +++ b/spec/coverage/instrument.js @@ -7,11 +7,14 @@ var glob = require('glob') var Instrumenter = require('istanbul').Instrumenter var mkdirp = require('mkdirp') var path = require('path') +var rimraf = require('rimraf') var instrumenter = new Instrumenter() var outputPath = path.join(__dirname, '..', '..', 'out', 'coverage') var libPath = path.join(__dirname, '..', '..', 'lib') +rimraf.sync(path.join(outputPath, 'lib')) + glob.sync('**/*.js', {cwd: libPath}).forEach(function (relativePath) { var rawPath = path.join(libPath, relativePath) var raw = fs.readFileSync(rawPath, 'utf8') diff --git a/spec/package.json b/spec/package.json index d673a81dbd6e..f0268586bc84 100644 --- a/spec/package.json +++ b/spec/package.json @@ -12,6 +12,7 @@ "mocha": "2.1.0", "multiparty": "4.1.2", "q": "0.9.7", + "rimraf": "^2.5.4", "temp": "0.8.1", "walkdir": "0.0.7", "ws": "0.7.2",