Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make tests for CI friendly #2

Merged
merged 3 commits into from

3 participants

@rmg
Owner

CI does not run "npm test", so --noAuth and --noSetup are not set.

Using NODE_ENV instead probably makes more sense here.

@slnode
Owner

Test PASSed. To trigger a build add comment - ".test\W+please"
Refer to this link for build results: http://ci.strongloop.com/job/sn-example-blog/84/

@rmg
Owner

@sam-github @raymondfeng you two seem to be the main contributors, can I get a LGTM or some feedback when you have a chance?

@sam-github
Owner

LGTM

@rmg rmg merged commit b0cb737 into master
@rmg rmg deleted the feature/ci-improvements branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 21, 2013
  1. @rmg
  2. @rmg

    Simplify scripts.test

    rmg authored
  3. @rmg
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +1 −1  WORKSHOP.md
  2. +2 −2 config/config.js
  3. +1 −1  package.json
View
2  WORKSHOP.md
@@ -62,7 +62,7 @@ Add mocha test cases to /test and name them as <test>-mocha.js.
In package.json, create a script:
"scripts": {
- "test": "./node_modules/mocha/bin/mocha --timeout 30000 --reporter spec test/*-mocha.js --noAuth"
+ "test": "NODE_ENV=test mocha --timeout 30000 --reporter spec test/*-mocha.js"
},
7. Add client side stuff
View
4 config/config.js
@@ -21,11 +21,11 @@ exports.cors = {
};
exports.auth = {
- enabled: process.argv.indexOf('--noAuth') == -1
+ enabled: process.env.NODE_ENV != 'test'
};
exports.demo = {
- enabled: process.argv.indexOf('--noSetup') == -1,
+ enabled: process.env.NODE_ENV != 'test',
user: 'strongloop',
password: 'password'
};
View
2  package.json
@@ -5,7 +5,7 @@
"main": "app.js",
"scripts": {
"start": "node app",
- "test": "./node_modules/mocha/bin/mocha --timeout 30000 --reporter spec test/*-mocha.js --noAuth --noSetup"
+ "test": "NODE_ENV=test mocha --timeout 3000 --reporter spec"
},
"dependencies": {
"express": "~3.4.4",
Something went wrong with that request. Please try again.