Skip to content

Commit

Permalink
Merge branch 'master' into issue/2478
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull authored Jan 18, 2017
2 parents 808cd53 + fc1be2c commit 91327ff
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 24 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage/
lib/to-iso-string/**/*.js
mocha.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ npm-debug.log*
.karma/
*.orig
.nyc_output/
coverage/
10 changes: 10 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"reporter": [
"json",
"text-summary"
],
"exclude": [
"lib/browser",
"test/**/*"
]
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 @@ -54,24 +63,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 @@ -80,22 +89,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 @@ -104,49 +113,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
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
# Mocha needs YOU!

*Did you know* Mocha [is a dependency of over 100,000 projects](https://libraries.io/npm/mocha) published to npm alone?

**Despite this, we're currently unable to merge most pull requests due to lack of maintenance resources.**

**Are you interested in triaging issues or reviewing open PRs? Have some time to hack on its codebase?** If you would like to help maintain Mocha, please contact `@boneskull` on [Gitter](https://gitter.im/mochajs/mocha).

*Thank you* :kissing_heart: to all of you interested in helping. These are Mocha's immediate needs:

1. Increase test coverage on Node.js and browser
- Increase integration coverage for all reporters
- `html` reporter must be tested in browser
- Basic console reporters (*not* `nyan`, `landing`, etc.) must be tested in **both** browser and Node.js contexts; PhantomJS can consume all console reporters
- Filesystem-based reporters must be tested in Node.js context
- Increase coverage against all interfaces (`exports` in particular). Ideally this becomes a "matrix" where we repeat sets of integration tests across all interfaces.
- Refactor non-Node.js-specific tests to allow them to run in a browser context. Node.js-specific tests include those which *require* the CLI or filesystem. Most everything else is fair game.
2. Review current open pull requests
- We need individuals familiar with Mocha's codebase. Got questions? Ask them in [our chat room](https://gitter.im/mochajs/mocha).
- Pull requests **must** have supporting tests. The only exceptions are pure cosmetic or non-functional changes.
- Pull request contributors must sign the CLA.
3. Close old, inactive issues and pull requests
- A bot should do this. We need a bot. Got a bot?
4. Triage issues
- If we run into "critical" bugs, they need fixing.
- "Critical" means Mocha is broken w/o workarounds for a *large percentage* of users
- Otherwise: respond to issues, close new dupe issues, confirm bugs, ask for more info, etc.

Once we gain ground on the above items, we can work together formalize our contribution guidelines and governance. For further info & ideas, please see our [projects](https://github.com/orgs/mochajs/projects).

*You needn't be a maintainer to submit a pull request for test coverage!*

-- @boneskull, *Jan 17 2016*

<br><br>
<p align="center">
<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
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@
"npm": ">= 1.4.x"
},
"scripts": {
"test": "make test"
"test": "make test",
"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 @@ -318,12 +321,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.3.0",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "^2.0.0",
Expand All @@ -332,6 +337,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 91327ff

Please sign in to comment.