Skip to content

Commit

Permalink
Merge branch 'master' into cr-indentContexts
Browse files Browse the repository at this point in the history
  • Loading branch information
charlierudolph committed Jun 5, 2017
2 parents aa24e82 + f20de56 commit 296cb23
Show file tree
Hide file tree
Showing 84 changed files with 997 additions and 730 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
@@ -1,3 +1,4 @@
root: true
env:
node: true
browser: true
Expand Down
51 changes: 51 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -0,0 +1,51 @@
# Mocha Code of Conduct

## Be friendly and patient
We understand that everyone has different levels of experience or knowledge in many diverse fields, be it technical or
non-technical in nature. We also have areas of knowledge we are eager to expand; we want to be a community where people
can not only contribute, but feel comfortable to ask questions as well and learn along the way. If someone says something
wrong, or says something accidentally offensive, respond with patience and try to keep it polite and civil. Remember that
we all were newbies at one point.

## Be welcoming
We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not
limited to, members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class,
educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief,
religion, and mental and physical ability.

## Be considerate
Your work will be used by other people, and you in turn will depend on the work of others. Any decision you make will affect
users and colleagues, and you should take those consequences into account when making decisions. Remember that we’re a world-wide
community, so you might not be communicating in someone else’s primary language.

## Be respectful
Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all
experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important
to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the JS Foundation
community should be respectful when dealing with other members as well as with people outside the JS Foundation community.

## Be careful in the words that you choose
We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put
down other participants. Harassment and other exclusionary behavior aren’t acceptable. This includes, but is not limited to:

* Violent threats or language directed against another person.
* Discriminatory jokes and language.
* Posting sexually explicit or violent material.
* Posting (or threatening to post) other people’s personally identifying information (“doxing”).
* Personal insults, especially those using racist or sexist terms.
* Unwelcome sexual attention.
* Advocating for, or encouraging, any of the above behavior.
* Repeated harassment of others. In general, if someone asks you to stop, then stop.

## When we disagree, try to understand why
Disagreements, both social and technical, happen all the time and JS Foundation projects are no exception. It is important
that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of the JS
Foundation comes from its varied community, people from a wide range of backgrounds. Different people have different
perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t
forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues
and learning from mistakes.

Original text courtesy of the Speak Up! project and Django Project.

## QUESTIONS?
If you have questions, please see the FAQ. If that doesn’t answer your questions, feel free to email conduct@js.foundation.
File renamed without changes.
39 changes: 39 additions & 0 deletions .github/stale.yml
@@ -0,0 +1,39 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 120
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pr-please
- confirmed
- future
- bug
- chore
- feature
- unconfirmed
- usability
- to-merge
- browser
- reporter
- feature
- documentation
- nice-to-have
- needs-review
- qa
- usability
- semver-minor
- semver-major
- semver-patch
- reporter
- common-mistake
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
I am a bot that watches issues for inactivity.
This issue hasn't had any recent activity, and I'm labeling it `stale`. In 14 days, if there are no further comments or activity, I will close this issue.
Thanks for contributing to Mocha!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,5 @@ npm-debug.log*
.nyc_output/
coverage/
BUILDTMP/
yarn.lock
package-lock.json
2 changes: 2 additions & 0 deletions .npmrc
@@ -0,0 +1,2 @@
package-lock=false

26 changes: 14 additions & 12 deletions .travis.yml
Expand Up @@ -15,8 +15,10 @@ env:
matrix:
fast_finish: true
include:
- node_js: '7'
- node_js: '8'
env: TARGET=test-node COVERAGE=true
- node_js: '7'
env: TARGET=test-node
- node_js: '6'
env: TARGET=test-node
- node_js: '5'
Expand All @@ -31,37 +33,37 @@ matrix:
env: TARGET=test-node
- node_js: '0.10'
env: TARGET=test-node
- node_js: '7'
- node_js: '8'
env: TARGET=lint
# phantomjs
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser
# chrome
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="chrome@latest" PLATFORM="Windows 8"
# edge
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="MicrosoftEdge@latest" PLATFORM="Windows 10"
# ie11
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="internet explorer@11.0" PLATFORM="Windows 8.1"
# ie10
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="internet explorer@10.0" PLATFORM="Windows 8"
# ie9
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="internet explorer@9.0" PLATFORM="Windows 7"
# ie8
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="internet explorer@8.0" PLATFORM="Windows 7"
# ie7
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="internet explorer@7.0" PLATFORM="Windows XP"
# firefox
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="firefox@latest" PLATFORM="Windows 8.1"
# safari
- node_js: '7'
- node_js: '8'
env: TARGET=test-browser BROWSER="safari@latest" PLATFORM="OS X 10.11"

before_install: scripts/travis-before-install.sh
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,22 @@
# 3.4.2 / 2017-05-24

## :bug: Fixes

- [#2802]: Remove call to deprecated os.tmpDir ([@makepanic])
- [#2820]: Eagerly set process.exitCode ([@chrisleck])

## :nut_and_bolt: Other

- [#2778]: Move linting into an npm script ([@Munter])

[@chrisleck]: https://github.com/chrisleck
[@makepanic]: https://github.com/makepanic
[@Munter]: https://github.com/Munter

[#2778]: https://github.com/mochajs/mocha/pulls/2778
[#2802]: https://github.com/mochajs/mocha/issues/2802
[#2820]: https://github.com/mochajs/mocha/pull/2820

# 3.4.1 / 2017-05-14

Fixed a publishing mishap with git's autocrlf settings.
Expand Down
52 changes: 26 additions & 26 deletions Makefile
Expand Up @@ -63,79 +63,79 @@ test-jsapi:

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

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

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

test-requires:
@printf "==> [Test :: Requires]\n"
$(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 \
--require test/acceptance/require/d.coffee \
test/acceptance/require/require.spec.js
--require test/require/a.js \
--require test/require/b.coffee \
--require test/require/c.js \
--require test/require/d.coffee \
test/require/require.spec.js

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

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

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

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

test-glob:
@printf "==> [Test :: Glob]\n"
bash ./test/acceptance/glob/glob.sh
bash ./test/glob/glob.sh

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

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

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

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

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

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

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

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

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

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

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

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

@echo spec:
@cat /tmp/spec.out
Expand Down
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -11,16 +11,17 @@
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
- ~~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~~
- **UPDATE - May 24 2017**: Thanks to [community contributions](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#mag-coverage), the coverage on most reporters has increased dramatically! The `html` reporter is still in [dire need of coverage](https://coveralls.io/builds/11674428/source?filename=lib%2Freporters%2Fhtml.js).
- 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?
- ~~A bot should do this. We need a bot. Got a bot?~~ We now use GitHub's own [probot-stale](https://www.npmjs.com/package/probot-stale).
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
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
@@ -1,5 +1,6 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '7'
- nodejs_version: '6'
- nodejs_version: '4'
Expand Down
21 changes: 19 additions & 2 deletions bin/_mocha
Expand Up @@ -99,6 +99,7 @@ program
.option('--no-warnings', 'silence all node process warnings')
.option('--opts <path>', 'specify opts path', 'test/mocha.opts')
.option('--perf-basic-prof', 'enable perf linux profiler (basic support)')
.option('--napi-modules', 'enable experimental NAPI modules')
.option('--prof', 'log statistical profiling information')
.option('--log-timer-events', 'Time events including external callbacks')
.option('--recursive', 'include sub directories')
Expand All @@ -111,7 +112,9 @@ program
.option('--use_strict', 'enforce strict mode')
.option('--watch-extensions <ext>,...', 'additional extensions to monitor with --watch', list, [])
.option('--delay', 'wait for async suite definition')
.option('--allow-uncaught', 'enable uncaught errors to propagate');
.option('--allow-uncaught', 'enable uncaught errors to propagate')
.option('--forbid-only', 'causes test marked with only to fail the suite')
.option('--forbid-pending', 'causes pending tests and test marked with skip to fail the suite');

program._name = 'mocha';

Expand Down Expand Up @@ -333,6 +336,14 @@ if (program.retries) {
mocha.suite.retries(program.retries);
}

// --forbid-only

if (program.forbidOnly) mocha.forbidOnly();

// --forbid-pending

if (program.forbidPending) mocha.forbidPending();

// custom compiler support

var extensions = ['js'];
Expand Down Expand Up @@ -476,12 +487,18 @@ function exitLater (code) {
}

function exit (code) {
var clampedCode = Math.min(code, 255);

// Eagerly set the process's exit code in case stream.write doesn't
// execute its callback before the process terminates.
process.exitCode = clampedCode;

// flush output for Node.js Windows pipe bug
// https://github.com/joyent/node/issues/6247 is just one bug example
// https://github.com/visionmedia/mocha/issues/333 has a good discussion
function done () {
if (!(draining--)) {
process.exit(Math.min(code, 255));
process.exit(clampedCode);
}
}

Expand Down

0 comments on commit 296cb23

Please sign in to comment.