-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makes e2e tests optionals and ease their setup (#67)
* Skip tests requiring missing env. variables E2E tests require secrets and tokens to be set. Skip those tests when the environment variables are missing. * Fix makefile - `mocha` config moved to “test/mocha.opts”; - `npm test` doesn’t required make; - add coverage task; - ensure “node_modules/“ is up to date. * Set tests’ env. variable using `dotenv` [dotenv] will append process.env variables set in the “.env” file. Note that it won’t override existing environment variable. [dotenv]: https://github.com/motdotla/dotenv
- Loading branch information
Showing
9 changed files
with
165 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules/ | ||
node_modules/ | ||
coverage/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
test: | ||
mocha --recursive --reporter spec --slow 1 | ||
|
||
coveralls: | ||
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec --recursive && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage | ||
|
||
.PHONY: test | ||
test: node_modules .env | ||
npm test | ||
|
||
coverage: coverage/lcov.info | ||
node_modules/.bin/istanbul report text | ||
|
||
coveralls: coverage/lcov.info | ||
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage | ||
|
||
.PHONY: test coverage coveralls | ||
|
||
.env: | ||
@echo "BITBUCKET_CONSUMER_PUBLIC=" > $@ | ||
@echo "BITBUCKET_CONSUMER_SECRET=" >> $@ | ||
@echo "" >> $@ | ||
@echo "FLICKR_CONSUMER_key=" >> $@ | ||
@echo "FLICKR_CONSUMER_SECRET=" >> $@ | ||
@echo "" >> $@ | ||
@echo "LINKEDIN_CONSUMER_PUBLIC=" >> $@ | ||
@echo "LINKEDIN_CONSUMER_SECRET=" >> $@ | ||
@echo "" >> $@ | ||
@echo "OPENBANK_CONSUMER_PUBLIC=" >> $@ | ||
@echo "OPENBANK_CONSUMER_SECRET=" >> $@ | ||
@echo "" >> $@ | ||
@echo "TWITTER_CONSUMER_PUBLIC=" >> $@ | ||
@echo "TWITTER_CONSUMER_SECRET=" >> $@ | ||
@echo "TWITTER_TOKEN_PUBLIC=" >> $@ | ||
@echo "TWITTER_TOKEN_SECRET=" >> $@ | ||
|
||
coverage/lcov.info: node_modules package.json oauth-1.0a.js .env test/*.js test/**/*.js test/mocha.opts | ||
node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly | ||
|
||
node_modules: package.json | ||
npm install | ||
touch node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--recursive | ||
--reporter spec | ||
--require dotenv/config | ||
--slow 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters