Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
tuxfile.js new default recipe file
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Mar 27, 2015
1 parent a39cb4b commit cef8bd4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#Changelog
## v1.6.0 2015-Mar-27
* Setup
* tuxfile.js is default recipe filename
* Dependency
* Update *gulp-load-plugins* to v0.9
* Update *request* to v2.54

## v1.5.2 2015-Mar-17
* Dependency
* Update *serve-index* to v1.6.3 to avoid XSS security advisory
Expand Down
26 changes: 15 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@

// load files
try {
pkg = require(packagePath);
recipe = require(path.join(appRoot.path, "tuxfile.js"));
} catch (e) {
throw new ReferenceError("Missing package.json in your project root: " + packagePath);
}
if (pkg.tuxharness === undefined) {
throw new ReferenceError(missingRecipe);
}
recipePath = path.join(appRoot.path, pkg.tuxharness);
try {
recipe = require(recipePath);
} catch (e) {
throw new ReferenceError(missingRecipe + ": " + recipePath);
try {
pkg = require(packagePath);
} catch (e) {
throw new ReferenceError("Missing package.json in your project root: " + packagePath);
}
if (pkg.tuxharness === undefined) {
throw new ReferenceError(missingRecipe);
}
recipePath = path.join(appRoot.path, pkg.tuxharness);
try {
recipe = require(recipePath);
} catch (e) {
throw new ReferenceError(missingRecipe + ": " + recipePath);
}
}

serverPort = recipe.register && recipe.register.port || 4000;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuxharness",
"version": "1.5.2",
"version": "1.6.0",
"description": "Test User eXperience Harness",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -52,11 +52,11 @@
"gulp-develop-server": "0.4.x",
"gulp-expect-file": "0.0.x",
"gulp-jshint": "1.9.x",
"gulp-load-plugins": "0.8.x",
"gulp-load-plugins": "0.9.x",
"gulp-mocha": "2.0.x",
"jade": "1.9.x",
"jshint-stylish": "1.0.x",
"request": "2.53.x"
"request": "2.54.x"
},
"engines": {
"node": "0.10",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Build a stand-alone test harness with dynamic data to quickly prototype and isol
## JSON browser extentions
* Firefox [JSONView](https://addons.mozilla.org/en-US/firefox/addon/jsonview/)
* Chrome [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc)
* Safari [safari-json-formatter](/~https://github.com/rfletcher/safari-json-formatter)

## Roadmap
1. Set tuxfile.js in project route as fallback
1. Allow remote recipes
* Views and data too
1. Host demo
Expand Down

0 comments on commit cef8bd4

Please sign in to comment.