Permalink
Browse files

Add test to .npmignore, allow tests to pass without test

.npmignore tests. Fixes #1191

Closes gh-1192
  • Loading branch information...
1 parent fa3d086 commit 8fea844363e20a01e67a9ec72a43353225a6eaec @tmcw tmcw committed with ariya Jun 17, 2015
Showing with 14 additions and 5 deletions.
  1. +1 −1 .npmignore
  2. +2 −4 package.json
  3. +11 −0 unit-tests.js
View
@@ -4,5 +4,5 @@
/assets/
/coverage/
/demo/
-/test/3rdparty
/tools/
+/test/
View
@@ -10,9 +10,7 @@
"version": "2.3.0",
"files": [
"bin",
- "test/run.js",
- "test/runner.js",
- "test/test.js",
+ "unit-tests.js",
"esprima.js"
],
"engines": {
@@ -57,7 +55,7 @@
"scripts": {
"generate-regex": "node tools/generate-identifier-regex.js",
- "test": "node test/run.js && npm run lint && npm run coverage",
+ "test": "node unit-tests.js && npm run lint && npm run coverage",
"lint": "npm run check-version && npm run eslint && npm run jscs && npm run complexity",
"check-version": "node tools/check-version.js",
View
@@ -0,0 +1,11 @@
+'use strict';
+
+// Allow tests to pass even if the test directory has not been included
+var fs = require('fs'),
+ path = require('path');
+
+fs.exists(path.join(__dirname, '/test'), function(exists) {
+ if (exists) {
+ require('./test/run.js');
+ }
+});

0 comments on commit 8fea844

Please sign in to comment.