Skip to content

Commit

Permalink
Add test to .npmignore, allow tests to pass without test
Browse files Browse the repository at this point in the history
.npmignore tests. Fixes jquery#1191

Closes jquerygh-1192
  • Loading branch information
tmcw authored and ariya committed Jun 23, 2015
1 parent fa3d086 commit 8fea844
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
/assets/
/coverage/
/demo/
/test/3rdparty
/tools/
/test/
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions unit-tests.js
Original file line number Diff line number Diff line change
@@ -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.