Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mochajs/mocha
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5bd33a0ba201d227159759e8ced86756595b0c54
Choose a base ref
...
head repository: mochajs/mocha
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5f96d511dbf913f135b92198aab721a27f6b44fe
Choose a head ref

Commits on Apr 8, 2018

  1. Tap reporter: report thrown error messages (#3317)

    original work by @chrmod; continuation of PR #2908. 
    
    BREAKING CHANGES; SEMVER MAJOR
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored Apr 8, 2018
    Copy the full SHA
    1acea30 View commit details

Commits on Apr 12, 2018

  1. Implement API documentation using npm:documantation.

    Fixes #3138
    Replaces and closes #3239
    
    basically working
    
    Suite and utils work
    
    Runner and Suite datatypes work
    
    Hook extends Runnable - at least link in description
    
    hook is child of mocha and has error
    
    first solid pass
    
    Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820
    
    Switch API documenation to html output, link to them, include in site build
    
    Update TOC
    
    Bring lock file in sync with package.json
    
    Linting
    
    Update package-lock.json
    dfberry authored and Munter committed Apr 12, 2018
    Copy the full SHA
    2f48a23 View commit details
  2. update CHANGELOG for v5.1.0 [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 12, 2018
    Copy the full SHA
    56e8452 View commit details
  3. Release v5.1.0

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 12, 2018
    Copy the full SHA
    3ac8e55 View commit details
  4. update package-lock.json [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 12, 2018
    Copy the full SHA
    58efe58 View commit details

Commits on Apr 18, 2018

  1. fix ESLint problems and consolidate configuration

    - we weren't being strict enough about disallowing ES6.  even though we
      had `es6: false` in the config, the `parserOptions` were set to use
      `ecmaVersion: 8`.  oops
    - linted a couple files
    - deleted all `.eslintrc.yml` files except for the root one; use `overrides`
      instead
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    2d1b49c View commit details
  2. update outdated info in docs/README.md [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    07e1ed2 View commit details
  3. update CHANGELOG.md for v5.1.1 [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    d2f6a25 View commit details
  4. Release v5.1.1

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    471ab31 View commit details
  5. Copy the full SHA
    a6115ac View commit details
  6. remove Node.js v7 from AppVeyor build; add Node.js v9

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    e288dbb View commit details
  7. fixed redundant images folders

    loged in commit for CLA (+1 squashed commit)
    Squashed commits:
    [0f603e3] fixed redundant images folders
    
    fixed path in bin/_mocha
    DavNej authored and boneskull committed Apr 18, 2018
    2
    Copy the full SHA
    ad54763 View commit details
  8. update contributors [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 18, 2018
    Copy the full SHA
    d3d7799 View commit details

Commits on Apr 21, 2018

  1. fix growl asset paths

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 21, 2018
    Copy the full SHA
    8a909b5 View commit details
  2. remove old svg logo

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 21, 2018
    Copy the full SHA
    3a65a64 View commit details
  3. Copy the full SHA
    9270018 View commit details
  4. Fix missing LICENSE

    Munter committed Apr 21, 2018
    Copy the full SHA
    3368a7e View commit details
  5. Copy the full SHA
    36e2086 View commit details
  6. Copy the full SHA
    82ced6c View commit details
  7. use renamed @mocha/docdash

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored and Munter committed Apr 21, 2018
    Copy the full SHA
    7f8fa42 View commit details
  8. use custom docs/API.md instead of broken README.md

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored and Munter committed Apr 21, 2018
    Copy the full SHA
    efff26f View commit details

Commits on Apr 22, 2018

  1. add Prettier, ESLint and githook integrations

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 22, 2018
    Copy the full SHA
    58731d3 View commit details
  2. reformat everything with Prettier

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 22, 2018
    Copy the full SHA
    5fc5845 View commit details

Commits on Apr 23, 2018

  1. fix(bin/_mocha): Make --watch-extensions default to 'js'

    The change in c580294 to `--watch-extensions` failed to set a default value. This change specifies
    that default value.
    
    Fixes #3336
    plroebuck authored and boneskull committed Apr 23, 2018
    Copy the full SHA
    9d407de View commit details

Commits on Apr 24, 2018

  1. update package-lock.json for npm@6 [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 24, 2018
    Copy the full SHA
    a7b1139 View commit details

Commits on Apr 27, 2018

  1. add Node.js v10 to build; fix win32 issues (#3350)

    * fix npm version to 5.x
    * AppVeyor: add Node.js v10; use npm ci for speed
    * revert package-lock.json to what npm@5 uses
    * add .gitattributes
    * remove linebreak-style from eslintrc
    * avoid all symlink tests on win32
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored Apr 27, 2018
    1
    Copy the full SHA
    1224a48 View commit details
  2. Copy the full SHA
    99c2f8a View commit details

Commits on Apr 30, 2018

  1. fix(ocd): re-order Node.js tests in .travis.yml (descending)

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 30, 2018
    1
    Copy the full SHA
    08dbaa3 View commit details
  2. remove dead code in bin/_mocha

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Apr 30, 2018
    Copy the full SHA
    1606f35 View commit details

Commits on May 1, 2018

  1. Annotate when exceptions are caught but ignored; closes #3354 (#3356)

    * style(*various*): Annotate when exceptions are caught but ignored
    
    There's an existing convertion to name intentionally ignored errors in catch block as `ignore`.
    Modified codebase to follow it.
    
    Fixes #3354
    
    * style(bin/options.js): Turn off prettier for single line
    
    Prettier reformatting is just wrong here. fs.readFileSync() should **not** be split across multiple
    lines.
    
    * Revert "style(bin/options.js): Turn off prettier for single line"
    
    This reverts commit eb034dd.
    
    * style(bin/options.js): Revert un-Prettier comment per Boneskull's request
    plroebuck authored and boneskull committed May 1, 2018
    Copy the full SHA
    8368722 View commit details

Commits on May 4, 2018

  1. Copy the full SHA
    7613521 View commit details

Commits on May 8, 2018

  1. feat(bin/options.js): Add support for comment lines in "mocha.opts"

    Modified code to strip comment lines, those beginning with a hash character ('#'), from "mocha.opts"
    prior to processing its contents.
    
    Fixes #3370
    plroebuck authored and Bamieh committed May 8, 2018
    Copy the full SHA
    cd3e1b3 View commit details
  2. docs(docs/index.md): Update "mocha.opts" documentation

    Added information on file content, noting support for comment/blank lines.
    plroebuck authored and Bamieh committed May 8, 2018
    Copy the full SHA
    aef1b0f View commit details
  3. migrate Mocha's tests to Unexpected assertion library (#3343)

    * convert tests to use Unexpected as assertion library
    
    Squashed commits:
    [fc418f8] remove extra call to done() in test/unit/runnable.spec.js
    [f1bc24f] lint test/browser-specific/setup.js
    [48af58c] fix test flake in ESM test
    [346ab5c] convert bundle and browser-specific tests to unexpected
    [c76b2f4] fix typo in test/README.md [ci skip]
    [783f16a] add test/README.md [ci skip]
    [a5949bb] convert all "only" tests to unexpected
    [15c921e] lint test/integration/diffs.spec.js
    [0d7635e] convert all individual reporter tests to unexpectedalso don't eat `STDOUT`--this means the tests have more output--could be
    useful for debugging.
    [190f5ed] convert compiler tests to unexpected
    [822b115] fix test/integration/glob.spec.js
    [db4853d] fix jsapi test
    [6f9831d] remove debugs from test/integration/diffs.spec.js
    [4cfbe4f] remove useless manual browser tests that will never get used properly
    [4e1d97b] convert test/reporters/base.spec.js to unexpected- add `chai` as dependency for `chai`-specific test, since the old one
    was based on what we thought it should be, not what it actually is.
    - improve test output: stop eating `STDOUT` and use color where possible
    [a8378f9] convert test/node-unit/color.spec.js to unexpected
    [92f50de] convert test/integration/reporters.spec.js to unexpected
    [652a331] remove global assert
    [ec857ef] convert test/integration/diffs.spec.js to unexpectedthis required a bit of massaging, since I had to change the
    fixture to use `assert`, which produces slightly different output.also move `getDiffs()` out of `test/integration/helpers.js`,
    since it's only used in `test/integration/diffs.spec.js`.
    [436e85d] remove userland assert moduleit's safe to use the built-in assert module.
    [dd7aec7] remove expect.js & karma-expect; add karma-unexpected
    [01dff70] lint test/setup.js
    [77203bf] convert test/integration/regression.spec.js to unexpected
    [e9eb05e] add more assertions; fix others
    [241159e] convert test/require/require.spec.js to unexpected
    [eb6bcff] convert test/integration/options.spec.js to unexpected
    [ada86aa] add custom assertions
    [5368ebe] convert test/integration/no-diff.spec.js to unexpected
    [043cfe3] convert test/integration/glob.spec.js to unexpected
    [df748a3] convert test/integration/compiler-globbing.spec.js to unexpected
    [5c0a8d0] convert test/interfaces/tdd.spec.js to unexpected
    [c6622a6] convert test/interfaces/qunit.spec.js to unexpected
    [1ecd62f] convert test/interfaces/exports.spec.js to unexpected
    [cabda05] convert test/interfaces/bdd.spec.js to unexpected
    [454018b] convert test/node-unit/stack-trace-filter.spec.js to unexpected
    [be6c332] fix unhelpful error thrown from lookupFiles; convert test/node-unit/file-utils.spec.js to unexpected
    [419d3ed] convert test/unit/grep.spec.js to unexpected
    [4837a6a] convert test/unit/hook-sync-nested.spec.js to unexpected
    [6d6b632] convert test/unit/hook-async.spec.js to unexpected
    [6ec01eb] convert test/unit/hook-sync.spec.js to unexpected
    [d4f6515] convert test/unit/ms.spec.js to unexpected
    [c43c096] convert test/unit/mocha.spec.js to unexpected
    [7aa9b82] convert test/unit/root.spec.js to unexpected
    [13a9e24] convert test/unit/runnable.spec.js to unexpected
    [cf9b376] convert test/unit/runner.spec.js to unexpected
    [efe37f9] simplify exception tests in test/unit/suite.spec.js
    [c08ba9e] convert test/unit/suite.spec.js to unexpected
    [41a85d9] convert test/unit/test.spec.js to unexpected
    [19f2d44] convert test/unit/throw.spec.js to unexpected
    [70ec725] convert test/unit/context.spec.js to unexpected
    [8c6cefd] convert test/unit/utils.spec.js to unexpected
    [a626278] add unexpected
    * fix missing assertion in an "options" integration test
    * convert new test in options.spec.js to unexpected
    * combine Chai test into a single assertion; increase timeout for reporter tests
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored May 8, 2018
    Copy the full SHA
    668b541 View commit details

Commits on May 17, 2018

  1. update all dependencies

    boneskull committed May 17, 2018
    Copy the full SHA
    42005f3 View commit details

Commits on May 18, 2018

  1. Copy the full SHA
    adea377 View commit details
  2. Copy the full SHA
    3d05aeb View commit details
  3. Release v5.2.0

    boneskull committed May 18, 2018
    Copy the full SHA
    2735e35 View commit details
  4. Copy the full SHA
    c4c421d View commit details
  5. Copy the full SHA
    df69279 View commit details

Commits on May 20, 2018

  1. fix markdown weirdness (#3386)

    Signed-off-by: Outsider <outsideris@gmail.com>
    outsideris authored May 20, 2018
    Copy the full SHA
    0d95e3f View commit details

Commits on May 31, 2018

  1. Copy the full SHA
    41cce5f View commit details

Commits on Jun 6, 2018

  1. Remove bower install instructions

    Remove installing mocha via bower instruction because mocha no longer supports bower installs.
    goteamtim authored and boneskull committed Jun 6, 2018
    Copy the full SHA
    d737ca2 View commit details
  2. Copy the full SHA
    eeccd05 View commit details

Commits on Jun 20, 2018

  1. Update _mocha

    Bamieh committed Jun 20, 2018
    Copy the full SHA
    e34e9f1 View commit details
  2. fix indentation

    Bamieh committed Jun 20, 2018
    Copy the full SHA
    babd958 View commit details

Commits on Jun 23, 2018

  1. add blocking mocha and test

    craigtaub authored and Bamieh committed Jun 23, 2018
    Copy the full SHA
    a5b5efc View commit details
  2. renamed to hanging

    craigtaub authored and Bamieh committed Jun 23, 2018
    Copy the full SHA
    e7ab24d View commit details
  3. test exit code

    craigtaub authored and Bamieh committed Jun 23, 2018
    Copy the full SHA
    63e7c28 View commit details
  4. rename file

    craigtaub authored and Bamieh committed Jun 23, 2018
    Copy the full SHA
    e67d1cf View commit details
Showing 513 changed files with 77,089 additions and 27,610 deletions.
11 changes: 11 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node >= 14
last 2 Chrome versions
last 2 Edge versions
last 2 Firefox versions
last 2 Safari versions
last 2 Opera versions
unreleased Chrome versions
unreleased Edge versions
unreleased Firefox versions
unreleased Safari versions
unreleased Opera versions
58 changes: 58 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
'use strict';

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(
require('@11ty/eleventy-plugin-inclusive-language'),
{
words:
'simply,obviously,basically,of course,clearly,everyone knows,however,easy'
}
);

eleventyConfig.addPassthroughCopy('docs/css');
eleventyConfig.addPassthroughCopy('docs/js');
eleventyConfig.addPassthroughCopy('docs/images');
eleventyConfig.addPassthroughCopy('docs/CNAME');
eleventyConfig.addPassthroughCopy('docs/_headers');
eleventyConfig.addPassthroughCopy('docs/favicon.ico');
eleventyConfig.addPassthroughCopy('docs/example');
eleventyConfig.addPassthroughCopy('docs/api/images');
eleventyConfig.addPassthroughCopy('docs/api/scripts');
eleventyConfig.addPassthroughCopy('docs/api/styles');

/* Markdown Plugins */
const markdown = require('markdown-it')({
html: true,
linkify: true,
typographer: true
});

markdown.use(require('markdown-it-anchor'), {
slugify: require('uslug'),
permalink: true,
permalinkBefore: true,
permalinkClass: 'direct-link',
permalinkSymbol: '#'
});

markdown.use(require('markdown-it-attrs'), {
leftDelimiter: '{:',
rightDelimiter: '}'
});

markdown.use(require('markdown-it-prism'));

markdown.use(require('markdown-it-emoji'));

eleventyConfig.setLibrary('md', markdown);

eleventyConfig.setUseGitIgnore(false);

return {
passthroughFileCopy: true,
dir: {
input: 'docs',
output: 'docs/_site'
}
};
};
11 changes: 10 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
coverage/
mocha.js
mocha.js.map
*.fixture.js
docs/
docs/_site
docs/api
docs/_dist
docs/example
out/
!bin/mocha.js
!lib/mocha.js
test/integration/fixtures
!.*.js
*.min.js
101 changes: 94 additions & 7 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,102 @@
root: true
extends: semistandard
extends:
- semistandard
- plugin:prettier/recommended
env:
node: yes
browser: yes
es6: no
node: true
browser: true
es6: true
parserOptions:
ecmaVersion: 2018
ecmaFeatures:
jsx: false
sourceType: script
rules:
no-var: 0
strict:
- error
- safe
linebreak-style:
- error
- unix
overrides:
- files:
- 'docs/js/**/*.js'
env:
node: false
- files:
- '.eleventy.js'
- '.wallaby.js'
- 'package-scripts.js'
- 'karma.conf.js'
- 'bin/*'
- 'docs/_data/**/*.js'
- 'lib/cli/**/*.js'
- 'lib/nodejs/**/*.js'
- 'scripts/**/*.js'
- 'test/**/*.js'
- 'test/node-unit/**/*.js'
env:
browser: false
- files:
- lib/nodejs/esm-utils.js
- rollup.config.js
- scripts/pick-from-package-json.js
parserOptions:
ecmaVersion: 2018
sourceType: module
requireConfigFile: false # for @babel/eslint-parser
parser: '@babel/eslint-parser'
env:
browser: false
- files:
- test/**/*.{js,mjs}
env:
mocha: true
globals:
expect: readonly
- files:
- bin/*
- lib/**/*.js
rules:
no-restricted-globals:
- error
- name: setTimeout
message: &GH-237 See https://github.com/mochajs/mocha/issues/237
- name: clearTimeout
message: *GH-237
- name: setInterval
message: *GH-237
- name: clearInterval
message: *GH-237
- name: setImmediate
message: *GH-237
- name: clearImmediate
message: *GH-237
- name: Date
message: *GH-237
no-restricted-modules:
- error
- timers
no-restricted-syntax:
- error
# disallow `global.setTimeout()`, `global.setInterval()`, etc.
- selector: 'CallExpression[callee.object.name=global][callee.property.name=/(set|clear)(Timeout|Immediate|Interval)/]'
message: *GH-237
# disallow `new global.Date()`
- selector: 'NewExpression[callee.object.name=global][callee.property.name=Date]'
message: *GH-237
# disallow property access of `global.<timer>.*`
- selector: '*[object.object.name=global][object.property.name=/(Date|(set|clear)(Timeout|Immediate|Interval))/]:expression'
message: *GH-237
- files:
- test/**/*.mjs
parserOptions:
ecmaVersion: 2018
sourceType: module

- files:
- lib/reporters/*.js
rules:
no-restricted-syntax:
- error
# disallow Reporters using `console.log()`
- selector: 'CallExpression[callee.object.name=console][callee.property.name=log]'
message: &GH-3604 See https://github.com/mochajs/mocha/issues/3604
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
54 changes: 45 additions & 9 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -33,14 +33,14 @@ community should be respectful when dealing with other members as well as with p
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.
- 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

@@ -55,4 +55,40 @@ 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.
If you have questions, please see the FAQ. If that doesn’t answer your questions, feel free to email report@lists.openjsf.org.

# OpenJS Foundation Code of Conduct

The OpenJS Foundation and its member projects use the Contributor
Covenant v1.4.1 as its Code of Conduct. Refer to the following
for the full text:

- [english](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
- [translations](https://www.contributor-covenant.org/translations)

Refer to the section on reporting and escalation in this document for the specific emails that can be used to report and escalate issues.

## Reporting

### Project Spaces

For reporting issues in spaces related to a member project please use the email provided by the project for reporting. Projects handle CoC issues related to the spaces that they maintain. Projects maintainers commit to:

- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in
the section on Escalation when required.

### Foundation Spaces

For reporting issues in spaces managed by the OpenJS Foundation, for example, repositories within the OpenJS organization, use the email `report@lists.openjsf.org`. The Cross Project Council (CPC) is responsible for managing these reports and commits to:

- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in
the section on Escalation when required.

## Escalation

The OpenJS Foundation maintains a Code of Conduct Panel (CoCP). This is a foundation-wide team established to manage escalation when a reporter believes that a report to a member project or the CPC has not been properly handled. In order to escalate to the CoCP send an email to `"coc-escalation@lists.openjsf.org`.

For more information, refer to the full
[Code of Conduct governance document](https://github.com/openjs-foundation/cross-project-council/blob/master/FOUNDATION_CODE_OF_CONDUCT_REQUIREMENTS.md).
Loading