From 71de1caf19e08568a70c6e13ea755407f791d2c5 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 25 Mar 2016 13:04:14 +0000 Subject: [PATCH] Fix tests --- .gitignore | 2 ++ lib/index.js | 2 +- package.json | 5 ++++- scripts/runtests | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e920c16..b61cc20 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ node_modules # Optional REPL history .node_repl_history + +tests/out diff --git a/lib/index.js b/lib/index.js index 5fe0584..aa44390 100755 --- a/lib/index.js +++ b/lib/index.js @@ -6,6 +6,6 @@ const OPTIONS = { }; module.exports = transformTools.makeStringTransform('jsfuckify', OPTIONS, function (content, transformOptions, done) { - let newContent = transformer(content, transformOptions.config); + var newContent = transformer(content, transformOptions.config); done(null, newContent); }); diff --git a/package.json b/package.json index 12137c5..3b2d249 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,13 @@ "description": "", "main": "lib/index.js", "scripts": { + "postinstall": "npm run create-dirs", + "create-dirs": "mkdir -p bin/ tests/out", "build-cli": "browserify ./lib/cli.js -o ./bin/cli.js", "test": "./scripts/runtests", "lint": "eslint 'lib/'", - "coverage": "istanbul cover node_modules/.bin/_mocha -- --require scripts/test-helper.js --bail --recursive 'tests/**/*.js'", + "test-build": "browserify tests/build-test.js -t ./lib/index.js -o tests/out/build-test.js", + "coverage": "istanbul cover node_modules/.bin/_mocha -- --require scripts/test-helper.js --bail --recursive 'tests/*.js'", "mocha": "mocha --require scripts/test-helper.js --bail 'tests/**/*.js'" }, "bin": "./bin/cli.js", diff --git a/scripts/runtests b/scripts/runtests index 187df12..3d07368 100755 --- a/scripts/runtests +++ b/scripts/runtests @@ -6,8 +6,8 @@ echo ">> Linting..." eslint 'lib/' -echo ">> Testing Build..." -browserify ./test/test.js -t ./lib/index.js -o ./test/out.js +# echo ">> Testing Build..." +# npm run test-build echo ">> Testing Project..." npm run coverage