Skip to content

Commit

Permalink
Merge branch 'master' into avoid-dist-file-modification-in-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Jan 17, 2017
2 parents ab170ee + 3464e42 commit 9a6a93b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 24 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,3 +1,4 @@
coverage/
lib/to-iso-string/**/*.js
mocha.js
BUILDTMP
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ npm-debug.log*
*.orig
.nyc_output/
BUILDTMP/
coverage/
10 changes: 10 additions & 0 deletions .nycrc
@@ -0,0 +1,10 @@
{
"reporter": [
"json",
"text-summary"
],
"exclude": [
"lib/browser",
"test/**/*"
]
}
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -16,7 +16,7 @@ matrix:
fast_finish: true
include:
- node_js: '7'
env: TARGET=test-node
env: TARGET=test-node COVERAGE=true
- node_js: '6'
env: TARGET=test-node
- node_js: '5'
Expand All @@ -42,6 +42,8 @@ before_script: scripts/travis-before-script.sh

script: make $TARGET

after_success: "npm run postcoverage && <coverage/lcov.info ./node_modules/coveralls/bin/coveralls.js"

notifications:
urls:
# for gitter
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -77,7 +77,7 @@ Follow these steps to get going. If you are having trouble, don't be afraid to
- **Handy with JavaScript?** Please check out the issues labeled [`pr-please`](https://git.io/vXYu2).
- **Can you write good (and do other stuff good too)?** Help with the documentation. See the [issues for our site](https://github.com/mochajs/mochajs.github.io/issues).
- **Design your thing?** [Our site](https://github.com/mochajs/mochajs.github.io) needs your magic touch.
- **Know Mocha's codebase?** We could use your help triaging issues and/or reviewing pull requests. Please contact an [org member](https://github.com/mochajs/people), and we'll chat.
- **Know Mocha's codebase?** We could use your help triaging issues and/or reviewing pull requests. Please contact an [org member](https://github.com/orgs/mochajs/people), and we'll chat.
- **Want to build our community?** Mocha has a *lot* of users. We could use your help bringing everyone together in peace and harmony. Please contact an [org member](https://github.com/mochajs/people).
- **You can sell dirt to worms?** Let's raise Mocha's profile in the JavaScript and OSS communities. Please contact an [org member](https://github.com/mochajs/people)!
- **Wait--you write unit tests for *fun*?** A PR which increases coverage is unlikely to be turned down.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2016 JS Foundation and contributors, https://js.foundation
Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
47 changes: 28 additions & 19 deletions Makefile
Expand Up @@ -2,6 +2,15 @@ BROWSERIFY := "node_modules/.bin/browserify"
ESLINT := "node_modules/.bin/eslint"
KARMA := "node_modules/.bin/karma"
MOCHA := "bin/mocha"
NYC := "node_modules/.bin/nyc"

ifdef COVERAGE
define test_node
$(NYC) --report-dir coverage/reports/$(1) $(MOCHA)
endef
else
test_node := $(MOCHA)
endif

TM_BUNDLE = JavaScript\ mocha.tmbundle
SRC = $(shell find lib -name "*.js" -type f | sort)
Expand Down Expand Up @@ -55,24 +64,24 @@ test-jsapi:

test-unit:
@printf "==> [Test :: Unit]\n"
$(MOCHA) test/acceptance/*.js \
$(call test_node,unit) test/acceptance/*.js \
--growl \
test/*.js

test-integration:
@printf "==> [Test :: Integrations]\n"
$(MOCHA) --timeout 5000 \
$(call test_node,integration) --timeout 5000 \
test/integration/*.js

test-compilers:
@printf "==> [Test :: Compilers]\n"
$(MOCHA) --compilers coffee:coffee-script/register,foo:./test/compiler/foo \
$(call test_node,compilers) --compilers coffee:coffee-script/register,foo:./test/compiler/foo \
test/acceptance/test.coffee \
test/acceptance/test.foo

test-requires:
@printf "==> [Test :: Requires]\n"
$(MOCHA) --compilers coffee:coffee-script/register \
$(call test_node,requires) --compilers coffee:coffee-script/register \
--require test/acceptance/require/a.js \
--require test/acceptance/require/b.coffee \
--require test/acceptance/require/c.js \
Expand All @@ -81,22 +90,22 @@ test-requires:

test-bdd:
@printf "==> [Test :: BDD]\n"
$(MOCHA) --ui bdd \
$(call test_node,bdd) --ui bdd \
test/acceptance/interfaces/bdd.spec

test-tdd:
@printf "==> [Test :: TDD]\n"
$(MOCHA) --ui tdd \
$(call test_node,tdd) --ui tdd \
test/acceptance/interfaces/tdd.spec

test-qunit:
@printf "==> [Test :: QUnit]\n"
$(MOCHA) --ui qunit \
$(call test_node,qunit) --ui qunit \
test/acceptance/interfaces/qunit.spec

test-exports:
@printf "==> [Test :: Exports]\n"
$(MOCHA) --ui exports \
$(call test_node,exports) --ui exports \
test/acceptance/interfaces/exports.spec

test-glob:
Expand All @@ -105,49 +114,49 @@ test-glob:

test-reporters:
@printf "==> [Test :: Reporters]\n"
$(MOCHA) test/reporters/*.js
$(call test_node,reporters) test/reporters/*.js

test-only:
@printf "==> [Test :: Only]\n"
$(MOCHA) --ui tdd \
$(call test_node,only-tdd) --ui tdd \
test/acceptance/misc/only/tdd.spec

$(MOCHA) --ui bdd \
$(call test_node,only-bdd) --ui bdd \
test/acceptance/misc/only/bdd.spec

$(MOCHA) --ui qunit \
$(call test_node,only-bdd-require) --ui qunit \
test/acceptance/misc/only/bdd-require.spec

test-global-only:
@printf "==> [Test :: Global Only]\n"
$(MOCHA) --ui tdd \
$(call test_node,global-only-tdd) --ui tdd \
test/acceptance/misc/only/global/tdd.spec

$(MOCHA) --ui bdd \
$(call test_node,global-only-bdd) --ui bdd \
test/acceptance/misc/only/global/bdd.spec

$(MOCHA) --ui qunit \
$(call test_node,global-only-qunit) --ui qunit \
test/acceptance/misc/only/global/qunit.spec

test-mocha:
@printf "==> [Test :: Mocha]\n"
$(MOCHA) test/mocha
$(call test_node,mocha) test/mocha

non-tty:
@printf "==> [Test :: Non-TTY]\n"
$(MOCHA) --reporter dot \
$(call test_node,non-tty-dot) --reporter dot \
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/dot.out

@echo dot:
@cat /tmp/dot.out

$(MOCHA) --reporter list \
$(call test_node,non-tty-list) --reporter list \
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/list.out

@echo list:
@cat /tmp/list.out

$(MOCHA) --reporter spec \
$(call test_node,non-tty-spec) --reporter spec \
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/spec.out

@echo spec:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,9 @@
<img src="https://cldup.com/xFVFxOioAU.svg" alt="Mocha test framework"/>
</p>

[![Build Status](https://api.travis-ci.org/mochajs/mocha.svg?branch=master)](http://travis-ci.org/mochajs/mocha) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://api.travis-ci.org/mochajs/mocha.svg?branch=master)](http://travis-ci.org/mochajs/mocha)
[![Coverage Status](https://coveralls.io/repos/github/mochajs/mocha/badge.svg)](https://coveralls.io/github/mochajs/mocha)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![OpenCollective](https://opencollective.com/mochajs/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/mochajs/sponsors/badge.svg)](#sponsors)
<br><img alt="Mocha Browser Support h/t SauceLabs" src="https://saucelabs.com/browser-matrix/mochajs.svg" width="354">
Expand Down
8 changes: 7 additions & 1 deletion package.json
Expand Up @@ -300,7 +300,10 @@
},
"scripts": {
"test": "make test && make clean",
"preversion": "make test && make mocha.js && git add mocha.js"
"preversion": "make test && make mocha.js && git add mocha.js",
"precoverage": "rm -rf coverage",
"coverage": "COVERAGE=true npm run test",
"postcoverage": "istanbul-combine -d coverage -r lcov -r html coverage/reports/*/*.json"
},
"dependencies": {
"browser-stdout": "1.3.0",
Expand All @@ -319,12 +322,14 @@
"assert": "^1.4.1",
"browserify": "^13.0.0",
"coffee-script": "^1.10.0",
"coveralls": "^2.11.15",
"eslint": "^3.11.1",
"eslint-config-semistandard": "^7.0.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "2.0.1",
"expect.js": "^0.3.1",
"istanbul-combine": "^0.3.0",
"karma": "^1.1.0",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "^2.0.0",
Expand All @@ -333,6 +338,7 @@
"karma-phantomjs-launcher": "^1.0.2",
"karma-sauce-launcher": "^1.0.0",
"karma-spec-reporter": "0.0.26",
"nyc": "^10.0.0",
"os-name": "^2.0.1",
"phantomjs": "1.9.8",
"rimraf": "^2.5.2",
Expand Down

0 comments on commit 9a6a93b

Please sign in to comment.