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: eb781e25a0c212aca8c39a0c7c82d426442def68
Choose a base ref
...
head repository: mochajs/mocha
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 18a1055396744e3284b113bb114f52298f5e35ab
Choose a head ref

Commits on Aug 7, 2019

  1. Drop node.js v6 support (#3885)

    mojosoeun authored and juergba committed Aug 7, 2019

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    6df1284 View commit details
  2. Copy the full SHA
    9d3c584 View commit details
  3. Copy the full SHA
    8e6e747 View commit details

Commits on Aug 10, 2019

  1. Copy the full SHA
    6d7c32a View commit details

Commits on Aug 11, 2019

  1. Copy the full SHA
    7297b0a View commit details

Commits on Aug 13, 2019

  1. Copy the full SHA
    5f1cad5 View commit details

Commits on Aug 15, 2019

  1. Update yargs to v13.3.0 (#3986)

    Update yargs-parser to v13.1.1
    juergba authored Aug 15, 2019
    Copy the full SHA
    fafa9b9 View commit details

Commits on Aug 19, 2019

  1. Copy the full SHA
    a3644c6 View commit details

Commits on Aug 22, 2019

  1. Add link checking to docs build step (#3972)

    * Add link checking to docs build step
    
    * Update hyperlink to 4.3.0
    
    * Update @mocha/docdash to 2.1.2
    
    * Fix internal broken fragment links from jsdoc comments to front page
    
    * Mark source code line fragment link checks as TODO. They are runtime JS generated and can't be found by hyperlink
    
    * Document reporters.Base.prototype.epilogue as a member of the right thing, thus not breaking docs links
    
    * Update to hyperlink 4.3.1
    
    * Update to jsdoc 3.6.3
    
    * experiment: add acorn 7 as dev dependency to attempt to fix broken build
    
    * Fix broken links from tutorial. Use jsdoc link functionality instead of guessign url's
    
    * Make hyperlink skipfilter argument windows compatible
    Munter authored Aug 22, 2019
    Copy the full SHA
    ea26c3d View commit details

Commits on Aug 26, 2019

  1. Copy the full SHA
    f15e988 View commit details

Commits on Aug 31, 2019

  1. Adopt the OpenJSF Code of Conduct (#3971)

    * OJSF coc
    
    * update email
    craigtaub authored Aug 31, 2019
    Copy the full SHA
    d8ac68f View commit details

Commits on Sep 3, 2019

  1. Copy the full SHA
    802fb05 View commit details

Commits on Sep 9, 2019

  1. Improved watching with chokidar (#3980)

    Improved watching with chokidar.
    This change improves the file watching behavior and fixes #3912.
    
    * We introduce the `--watch-files` command line option. This option
      allows control over which files are and is separate and more powerful
      than `--extension`. Fixes #2702.
    * We introduce the `--watch-ignore` command line option that allows
      control over which files are not watched. Before this was hardcoded to
      `node_modules` and `.git`. See #2554.
    * The `chokidar` package now handles file watching.
    * New test files are picked up by the file watcher and run. Fixes #2176.
    * Watch hidden files based on extension
    Thomas Scholtes authored and juergba committed Sep 9, 2019
    Copy the full SHA
    123a0d7 View commit details

Commits on Sep 10, 2019

  1. add OpenJS Foundation logo to website (#4008)

    * add OpenJS Foundation logo to website
    
    * fix flaky template
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored Sep 10, 2019
    Copy the full SHA
    6ec07d6 View commit details

Commits on Sep 22, 2019

  1. Copy the full SHA
    eed38d7 View commit details

Commits on Sep 26, 2019

  1. uncaughtException: fix double EVENT_RUN_END events (#4025)

    abort runner instead of end event
    juergba authored Sep 26, 2019
    Copy the full SHA
    5f8df08 View commit details

Commits on Oct 3, 2019

  1. Copy the full SHA
    ba96962 View commit details

Commits on Oct 8, 2019

  1. Copy the full SHA
    3633a90 View commit details

Commits on Oct 9, 2019

  1. Copy the full SHA
    2de7c18 View commit details

Commits on Oct 12, 2019

  1. Release v6.2.1

    craigtaub authored and boneskull committed Oct 12, 2019
    Copy the full SHA
    ec17f63 View commit details

Commits on Oct 13, 2019

  1. special-case parsing of "require" in unparseNodeArgs(); closes #4035 (#…

    …4063)
    
    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull authored and juergba committed Oct 13, 2019
    Copy the full SHA
    006d772 View commit details
  2. Copy the full SHA
    2aef07d View commit details
  3. Copy the full SHA
    f78e21f View commit details

Commits on Oct 14, 2019

  1. Improve reporter documentation for mocha in browser. (#4026)

    You can pass the constructor function of your custom reporter in options and mocha will use it.
    Lindsay-Needs-Sleep authored and juergba committed Oct 14, 2019
    Copy the full SHA
    3a0ef50 View commit details
  2. npm audit fixes

    boneskull committed Oct 14, 2019
    Copy the full SHA
    9584202 View commit details

Commits on Oct 18, 2019

  1. update CHANGELOG for v6.2.2 [ci skip]

    Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
    boneskull committed Oct 18, 2019
    Copy the full SHA
    143596f View commit details
  2. 6.2.2

    boneskull committed Oct 18, 2019
    Copy the full SHA
    8a0b38b View commit details

Commits on Oct 19, 2019

  1. 2595 Changed runMocha to runMochaJSON in test/integration (#4077)

    * duplicate-arguments
    
    * suit.spec.js
    
    * ui.spec.js
    
    * lint error fixed
    soobing authored and craigtaub committed Oct 19, 2019
    Copy the full SHA
    f73e7c6 View commit details

Commits on Nov 2, 2019

  1. fix sponsors background color for readability (#3988)

    Signed-off-by: Outsider <outsideris@gmail.com>
    outsideris authored Nov 2, 2019
    Copy the full SHA
    503d017 View commit details

Commits on Nov 3, 2019

  1. Copy the full SHA
    ec8e2f8 View commit details

Commits on Nov 7, 2019

  1. Copy the full SHA
    b9fbd69 View commit details

Commits on Nov 22, 2019

  1. Copy the full SHA
    46ca9ac View commit details
  2. docs: Replace ☕ with emoji (#4092)

    pzrq authored and juergba committed Nov 22, 2019
    Copy the full SHA
    dca588d View commit details
  3. Add GH Funding Metadata

    SheetJSDev authored and boneskull committed Nov 22, 2019
    Copy the full SHA
    2de0618 View commit details
  4. Change sh to bash for code block

    HyunSangHan authored and boneskull committed Nov 22, 2019
    Copy the full SHA
    2e9c28a View commit details

Commits on Nov 23, 2019

  1. docs: clarify invalid usage of done() (#4101)

    When I first read 
    "anything else will cause a failed test"
    I considered that this might be a typo,
    and that this should say "a passed test"
    instead, because after all setting "no error"
    could mean "no error", right? I then understood
    that this sentence could also mean that
    "anything else is a programmer error", i.e. a bug
    and I was hoping that in _that_ case a clear
    error would be thrown.
    
    I tried things out and indeed found that the latter
    is the case
    
    > Error: done() invoked with non-Error: true
    
    This patch attempts to clarify that this is
    indeed all about a programmer error.
    jgehrcke authored and craigtaub committed Nov 23, 2019
    Copy the full SHA
    ebdee97 View commit details
  2. Add a description for installing GraphicsMagick or ImageMagick in doc…

    …s/README.md (#4045)
    
    * Add a troubleshooting in README for an error about gm
    
    * Solve linting
    
    * Change dirname from local to anonymous in the example error message
    
    * Add mentioning ImageMagick
    HyunSangHan authored and craigtaub committed Nov 23, 2019
    Copy the full SHA
    2e816fe View commit details

Commits on Nov 26, 2019

  1. Copy the full SHA
    47dcc5f View commit details
  2. add Node v13 to CI test matrix

    juergba authored and boneskull committed Nov 26, 2019
    Copy the full SHA
    e4e126f View commit details

Commits on Nov 29, 2019

  1. Update Chokidar to v3.3.0

    juergba authored Nov 29, 2019
    Copy the full SHA
    2f10309 View commit details

Commits on Dec 2, 2019

  1. Copy the full SHA
    8c5ed3a View commit details

Commits on Dec 3, 2019

  1. Copy the full SHA
    03b58f2 View commit details

Commits on Dec 13, 2019

  1. Type "rs\n" to restart tests, fixes #871 (#3979)

    * Type "rs\n" to restart tests, fixes #871
    
    Although the `--watch` feature is somewhat controversial (see #1780), is there any reason not to make it a little easier to use in the meantime?   This adds nodemon's shortcut (`rs\n`) for manually restarting.
    
    * fix lint errors, add unit test
    
    * write to mochaProcess.stdin
    
    * Trigger travis build
    
    * add documentation
    
    * restore trailing whitespace
    
    * empty commit (to rerun tests)
    broofa authored and craigtaub committed Dec 13, 2019
    Copy the full SHA
    aab8555 View commit details

Commits on Dec 15, 2019

  1. Copy the full SHA
    d4adfa6 View commit details
  2. Copy the full SHA
    25363e6 View commit details

Commits on Dec 16, 2019

  1. Update node-environment-flags to 1.0.6 (#4118)

    node-environment-flags 1.0.5 and lower do not contain a LICENSE file
    which can make compliance difficult.
    kylef authored and juergba committed Dec 16, 2019
    Copy the full SHA
    d9f5079 View commit details

Commits on Dec 22, 2019

  1. Copy the full SHA
    1412dc8 View commit details

Commits on Jan 1, 2020

  1. Copy the full SHA
    24c22be View commit details

Commits on Jan 3, 2020

  1. Copy the full SHA
    3bd2d28 View commit details
  2. Copy the full SHA
    35cf39b View commit details
Showing 332 changed files with 37,686 additions and 19,647 deletions.
12 changes: 12 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node >= 12
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
IE 11
20 changes: 17 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
'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
linkify: true,
typographer: true
});

markdown.use(require('markdown-it-anchor'), {
@@ -31,13 +42,16 @@ module.exports = function(eleventyConfig) {

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',
includes: '_includes',
output: 'docs/_site'
}
};
8 changes: 7 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
coverage/
mocha.js
mocha.js.map
mocha-es2018.js
*.fixture.js
docs/
docs/_site
docs/api
docs/_dist
docs/example
out/
!lib/mocha.js
test/integration/fixtures
!.*.js
*.min.js
59 changes: 36 additions & 23 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -3,42 +3,56 @@ extends:
- semistandard
- plugin:prettier/recommended
env:
node: yes
browser: yes
node: true
browser: true
es6: true
parserOptions:
ecmaVersion: 5
ecmaVersion: 2018
ecmaFeatures:
globalReturn: no
jsx: no
jsx: false
sourceType: script
rules:
no-var: 0
strict:
- error
- safe
overrides:
- files:
- scripts/**/*.js
- package-scripts.js
- karma.conf.js
- .wallaby.js
- .eleventy.js
- bin/*
- lib/cli/**/*.js
- test/node-unit/**/*.js
- test/integration/options/watch.spec.js
- test/integration/helpers.js
- lib/growl.js
- '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
- rollup_no-ie11.config.js
- scripts/pick-from-package-json.js
parserOptions:
ecmaVersion: 6
ecmaVersion: 2018
sourceType: module
requireConfigFile: false # for @babel/eslint-parser
parser: '@babel/eslint-parser'
env:
browser: no

browser: false
- files:
- test/**/*.{js,mjs}
env:
mocha: yes
mocha: true
globals:
expect: no
expect: readonly
- files:
- bin/*
- lib/**/*.js
@@ -73,11 +87,10 @@ overrides:
# 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: 6
ecmaVersion: 2018
sourceType: module

- files:
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).
100 changes: 50 additions & 50 deletions .github/CONTRIBUTING.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: mochajs
36 changes: 0 additions & 36 deletions .github/stale.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Browser Tests for forked PRs
'on':
pull_request_target:
types:
- labeled

jobs:
test-browser:
# TODO: configure to retain build artifacts in `.karma/` dir
name: 'Browser Tests'
timeout-minutes: 20
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run-browser-test')
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: '~/.npm'
key: "ubuntu-latest-node-full-v14-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-full-v14-
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
run: npm start test.browser
env:
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
- name: remove 'run-browser-test' label
uses: buildsville/add-remove-label@v1
if: ${{ always() }}
with:
token: ${{secrets.GITHUB_TOKEN}}
label: run-browser-test
type: remove
20 changes: 20 additions & 0 deletions .github/workflows/delete-runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Delete workflow runs
on:
workflow_dispatch:
inputs:
days:
description: 'Number of days'
required: true
default: 180

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: 10
201 changes: 201 additions & 0 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Tests
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
prevent-run-twice:
name: Prevent to run twice
runs-on: ubuntu-latest
# Run 'pull-request' event only on external PRs from forked repos.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- run: 'echo run Tests'
smoke:
name: 'Smoke [Node.js v${{ matrix.node }} / ${{ matrix.os }}]'
needs: prevent-run-twice
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-latest
- windows-2019
node:
- 12
- 14
- 16
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '${{ matrix.node }}'
- run: npm install --production
- run: npm run test:smoke

lint:
name: Linting code and markdown
runs-on: ubuntu-latest
needs: smoke
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/checkout@v2
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: '~/.npm'
key: "ubuntu-latest-node-v14-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-v14-
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: 'Check lint'
run: npm start lint

test-node:
name: 'Node.js [v${{ matrix.node }} / ${{ matrix.os }}]'
needs: smoke
runs-on: '${{ matrix.os }}'
env:
NODE_OPTIONS: '--trace-warnings'
strategy:
matrix:
os:
- ubuntu-latest
- windows-2019
node:
- 12
- 14
- 16
include:
- os: ubuntu-latest
node: 14
env:
COVERAGE: 1
steps:
# - name: Cache Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# id: cache-growl
# uses: actions/cache@v2
# with:
# path: GrowlInstaller
# key: '${{ runner.os }}-growl-installer'
# restore-keys: |
# ${{ runner.os }}-growl-installer
# - name: Download Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' && steps.cache-growl.outputs.cache-hit != 'true'}}"
# run: >
# echo "Downloading Growl installer..."

# mkdir GrowlInstaller | out-null

# $seaURL =
# "https://github.com/briandunnington/growl-for-windows/releases/download/final/GrowlInstaller.exe"

# $seaPath = "GrowlInstaller\GrowlInstaller.exe"

# $webclient = New-Object Net.WebClient

# $webclient.DownloadFile($seaURL, $seaPath)

# 7z x $seaPath -oGrowlInstaller | out-null

# echo "Done."
# - name: Retrieve Growl Installer (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# uses: actions/cache@v2
# with:
# path: GrowlInstaller
# key: '${{ runner.os }}-growl-installer'
# restore-keys: |
# ${{ runner.os }}-growl-installer
# - name: Add Growl Installer to Path (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# run: 'echo "C:\Program Files (x86)\Growl for Windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8'
# - name: Install Growl
# if: "${{ matrix.os == 'windows-2019' }}"
# run: |
# echo "Installing Growl..."
# cmd /c start /wait msiexec /i GrowlInstaller\Growl_v2.0.msi /quiet
# echo "Done."
# - name: Start Growl Service (Windows)
# if: "${{ matrix.os == 'windows-2019' }}"
# run: |
# echo "Starting Growl service..."
# Start-Process -NoNewWindow Growl
# ## Growl requires some time before it's ready to handle notifications
# echo "Verifying Growl responding"
# Start-Sleep -s 10
# growlnotify test
- name: Install libnotify-bin (Linux)
if: "${{ matrix.os == 'ubuntu-latest' }}"
run: sudo apt-get install libnotify-bin
- uses: actions/setup-node@v2
with:
node-version: '${{ matrix.node }}'
- uses: actions/checkout@v2
- name: 'Cache node_modules (Linux)'
if: "${{ matrix.os != 'windows-2019' }}"
uses: actions/cache@v2
with:
path: '~/.npm'
key: "${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Install Annotation Support
run: npm install mocha-github-actions-reporter
- name: Run All Node.js Tests
run: npm start test.node
env:
COVERAGE: '${{ matrix.env.COVERAGE }}'
MOCHA_REPORTER: mocha-github-actions-reporter
# this is so mocha-github-actions-reporter can find mocha
NODE_PATH: lib
- name: Generate Coverage Report (Linux + Node.js latest)
if: '${{ matrix.env.COVERAGE }}'
run: npm start coverage-report-lcov
- name: Upload Coverage to Coveralls (Linux + Node.js latest)
if: '${{ matrix.env.COVERAGE }}'
uses: coverallsapp/github-action@master
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
test-browser:
# TODO: configure to retain build artifacts in `.karma/` dir
name: 'Browser Tests'
needs: smoke
timeout-minutes: 20
runs-on: ubuntu-latest
# Run 'push' event only because of sauce labs token
if: github.event_name == 'push'
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/checkout@v2
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: '~/.npm'
# this key is different than above, since we are running scripts
# (builds, postinstall lifecycle hooks, etc.)
key: "ubuntu-latest-node-full-v14-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-full-v14-
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
run: npm start test.browser
env:
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
16 changes: 16 additions & 0 deletions .github/workflows/nightly-site-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Deploy `mochajs.org` branch nightly by hitting a netlify build URL.
# This updates the list of supporters

name: Nightly mochajs.org Deploy
on:
schedule:
- cron: '0 0 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Webhook Action
uses: joelwmale/webhook-action@1.0.0
env:
data: ''
WEBHOOK_URL: ${{ secrets.NETLIFY_NIGHTLY_DEPLOY_URL }}
25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Stale/close issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '30 0 * * 1,3,5'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
days-before-stale: 120
days-before-close: 14
stale-issue-message: >
This issue hasn't had any recent activity, and I'm labeling it `stale`.
Remove the label or comment or this issue will be closed in 14 days.
Thanks for contributing to Mocha!
stale-pr-message: >
This PR hasn't had any recent activity, and I'm labeling it `stale`.
Remove the label or comment or this PR will be closed in 14 days.
Thanks for contributing to Mocha!
exempt-issue-labels: browser,chore,confirmed-bug,developer-experience,documentation,faq,feature,future,good-first-issue,help wanted,nice-to-have,qa,reporter,unconfirmed-bug,usability
exempt-pr-labels: browser,chore,confirmed-bug,developer-experience,documentation,faq,feature,future,needs-review,nice-to-have,qa,reporter,semver-major,semver-minor,semver-patch,usability
operations-per-run: 200
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Mocha-specific
docs/_site
docs/_dist
docs/images/supporters
docs/api
mocha.js
mocha.js.map
mocha-es2018.js
.karma/
!lib/mocha.js

# Bundle debugging
stats.html

#########################################
# NON-MOCHA STUFF GOES BELOW THIS THING #
#########################################
@@ -141,3 +148,6 @@ Temporary Items

# SauceConnect
*.sock

# Local Netlify folder
.netlify
11 changes: 3 additions & 8 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"linters": {
"(bin/*|*.js|**/*.js)": ["eslint --fix", "git add"],
"(*.{json,yml,md,html}|**/*.{json,yml,md,html})": [
"prettier --write",
"git add"
]
},
"ignore": ["docs/**/*.js", "test/**/*.fixture.js", "package*.json"]
"@(**/*.js|bin/*)": ["eslint --fix"],
"!(package*).json": ["prettier --write"],
"*.{yml,md,html}": ["prettier --write"]
}
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -6,5 +6,6 @@
"first-header-h1": false,
"first-line-h1": false,
"commands-show-output": false,
"single-h1": false
"single-h1": false,
"fenced-code-language": false
}
19 changes: 13 additions & 6 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
require: test/setup
ui: bdd
require: 'test/setup'
ui: 'bdd'
global:
- okGlobalA,okGlobalB
- okGlobalC
- callback*
timeout: 300
- 'okGlobalA,okGlobalB'
- 'okGlobalC'
- 'callback*'
timeout: 1000
watch-ignore:
- '.*'
- 'docs/_dist/**'
- 'docs/_site/**'
- 'node_modules'
- 'coverage'
- 'cache'
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message=Release v%s
15 changes: 13 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -4,7 +4,18 @@
"text-summary"
],
"exclude": [
"lib/browser",
"test/**/*"
"coverage/**",
"docs/**",
"packages/*/test{,s}/**",
"**/*.d.ts",
"test{,s}/**",
"test{,-*}.{js,cjs,mjs,ts}",
"**/*{.,-}test.{js,cjs,mjs,ts}",
"**/__tests__/**",
"**/{karma,rollup,webpack}.config.js",
"**/{babel.config,.eslintrc,.mocharc}.{js,cjs}",
"lib/browser/**",
"package-scripts.js",
"scripts/**"
]
}
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

20 changes: 5 additions & 15 deletions .wallaby.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@ module.exports = () => {
},
'package.json',
'test/opts/mocha.opts',
'mocharc.yml'
'mocharc.yml',
'!lib/browser/growl.js'
],
filesWithNoCoverageCalculated: [
'test/**/*.fixture.js',
@@ -36,7 +37,7 @@ module.exports = () => {
// running mocha instance is not the same as mocha under test,
// running mocha is the project's source code mocha, mocha under test is instrumented version of the source code
const runningMocha = wallaby.testFramework;
runningMocha.timeout(200);
runningMocha.timeout(1000);
// to expose it/describe etc. on the mocha under test
const MochaUnderTest = require('./');
const mochaUnderTest = new MochaUnderTest();
@@ -46,20 +47,9 @@ module.exports = () => {
'',
mochaUnderTest
);
// to make test/node-unit/color.spec.js pass, we need to run mocha in the project's folder context
const childProcess = require('child_process');
const execFile = childProcess.execFile;
childProcess.execFile = function() {
let opts = arguments[2];
if (typeof opts === 'function') {
opts = {};
Array.prototype.splice.call(arguments, 2, 0, opts);
}
opts.cwd = wallaby.localProjectDir;
return execFile.apply(this, arguments);
};
require('./test/setup');
},
debug: true
debug: true,
runMode: 'onsave'
};
};
533 changes: 533 additions & 0 deletions AUTHORS

Large diffs are not rendered by default.

2,003 changes: 601 additions & 1,402 deletions CHANGELOG.md

Large diffs are not rendered by default.

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) 2011-2018 JS Foundation and contributors, https://js.foundation
Copyright (c) 2011-2021 OpenJS Foundation and contributors, https://openjsf.org

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
160 changes: 79 additions & 81 deletions MAINTAINERS.md

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions PROJECT_CHARTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Mocha Charter

This project charter serves as a statement of scope and objectives for the **Mocha** project.

## §1: Guiding Principles

The **Mocha** project is part of the [OpenJS Foundation], which operates transparently, openly, collaboratively, and ethically. Project proposals, timelines, and status must not merely be open, but also easily visible to outsiders.

## §2: Scope

**Mocha** is a unopinionated, _general-purpose testing framework_ for the JavaScript community. **Mocha** favors flexibility over rigidity, stability over disruption, and deliberation over agility. **Mocha** aims to do one thing, and do it well. **Mocha** will strive to evolve with the needs of the community, but will make every effort not to abandon its current users in doing so.

### §2.1: In-Scope

- APIs ("interfaces") to write and organize tests written in JavaScript or compile-to-JavaScript languages
- Command-line executable to run tests in a Node.js-based terminal environment
- API to run tests in a browser environment
- Output test results and errors (provide "reporters") to:
- Terminal
- File
- Browser
- Memory
- APIs to extend functionality
- File-based and code-based configuration
- Internal test coverage for all of the above
- Documentation including (but not limited to):
- Website ([https://mochajs.org](https://mochajs.org)) contents and design
- Test-writing and test-organizing APIs
- Reporters
- [Extensible APIs](https://mochajs.org/api)
- Tutorials and [code samples](https://github.com/mochajs/mocha-examples)
- Command-line execution and options
- Browser-based execution and options
- [Project administration](https://github.com/mochajs/admin)
- [Contribution guide](https://github.com/mochajs/mocha/blob/master/.github/CONTRIBUTING.md)
- General support for multiple levels of tests, including (but not limited to):
- Unit tests
- Integration tests
- Functional/end-to-end tests
- Operational readiness tests
- Tool configuration for project tests, build, documentation or website deployment
- Bespoke tools, if needed
- LTS (long-term support) policies, processes, and release cadence
- Third-party service integrations (e.g., bots, CI servers, SCM)
- Project-endorsed spaces for collaboration (chat rooms, mailing lists, forums, etc.)
- Project-maintained social media, if any

### §2.2: Out-of-Scope

- [Test assertions](https://wikipedia.org/wiki/Test_assertion) and [mocks](https://en.wikipedia.org/wiki/Mock_object) or related
- Compatibility with other 3rd-party libraries not hosted under GitHub's [mochajs organization](https://github.com/mochajs) unless explicitly stated in [§2: Scope](#%c2%a72-scope)
- Note: _existence of "official" code samples does not imply explicit support_
- Efforts must be made to retain compatibility with popular libraries, frameworks and tools, but not at the expense of Mocha itself
- Use within _unmaintained_ versions of Node.js
- Use within browsers not meeting a threshold decided upon by maintainers
- Use within non-Node.js or non-browser environments, unless otherwise explicitly stated in [§2: Scope](#%c2%a72-scope)
- "Unofficial" collaboration or Q&A spaces (including Stack Overflow and Quora)
- Certain classes of contributions:
- Bug fixes or enhancements without associated test coverage
- Features having limited general-purpose use (as determined by maintainers)
- Bug fixes which "break" more users than are affected by the bug itself, _regardless_ of "correctness"
- Breaking changes to API without demonstrated need, especially those which would cause correct, currently-passing tests to fail
- Changes that significantly negatively impact performance without demonstrated need
- Code reviews, issue comments or pull requests which are dogmatic, demanding, or excessively critical as to discourage contributions by others
- Those which violate Mocha's [Code of Conduct]

## §3: Relationship with OpenJS Foundation CPC

Technical leadership for the projects within the [OpenJS Foundation] is delegated to the projects through their project charters by the [OpenJS Foundation Cross-Project Council](https://openjsf.org/about/governance/) (CPC). In the case of the Mocha project, it is delegated exclusively to the maintainers of Mocha. The OpenJS Foundation's business leadership is the Board of Directors.

Changes to the following **cannot** unilaterally be applied by project leadership, and must be ratified by the CPC:

- Mocha's Project Charter (this document)
- Mocha's [Code of Conduct]
- Mocha's licenses: [MIT](https://github.com/mochajs/mocha/blob/master/LICENSE) (for code) and [CC-BY-4.0](https://github.com/mochajs/mocha/blob/master/docs/LICENSE-CC-BY-4.0) (for documentation/website)

### §3.1: Other Formal Project Relationships

Section Intentionally Left Blank

## §4: Mocha's Governing Body

Mocha is governed by its maintainers. See [MAINTAINERS.md] for more information.

## §5: Roles & Responsibilities

The roles and responsibilities of Mocha's maintainers are described in [MAINTAINERS.md].

### §5.1: Project Operations & Management

Project operations and processes are described in [MAINTAINERS.md].

### §5.2: Decision-making, Voting, and/or Elections

Mocha uses a loose consensus-seeking process, described in [MAINTAINERS.md].

### §5.3: Other Project Roles

Section Intentionally Left Blank

## §6: Definitions

Section Intentionally Left Blank

[openjs foundation]: https://openjsf.org
[maintainers.md]: https://github.com/mochajs/mocha/blob/master/MAINTAINERS.md
[code of conduct]: https://github.com/mochajs/mocha/blob/master/.github/CODE_OF_CONDUCT.md
87 changes: 26 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,9 +2,20 @@
<img src="https://cldup.com/xFVFxOioAU.svg" alt="Mocha test framework"/>
</p>

<p align="center">:coffee: Simple, flexible, fun JavaScript test framework for Node.js & The Browser :coffee:</p>
<p align="center">☕️ Simple, flexible, fun JavaScript test framework for Node.js & The Browser ☕️</p>

<p align="center"><a href="http://travis-ci.org/mochajs/mocha"><img src="https://api.travis-ci.org/mochajs/mocha.svg?branch=master" alt="Build Status"></a> <a href="https://coveralls.io/github/mochajs/mocha"><img src="https://coveralls.io/repos/github/mochajs/mocha/badge.svg" alt="Coverage Status"></a> <a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=shield" alt="FOSSA Status"></a> <a href="https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter"></a> <a href="https://github.com/mochajs/mocha#backers"><img src="https://opencollective.com/mochajs/backers/badge.svg" alt="OpenCollective"></a> <a href="https://github.com/mochajs/mocha#sponsors"><img src="https://opencollective.com/mochajs/sponsors/badge.svg" alt="OpenCollective"></a>
<p align="center">
<a href="https://github.com/mochajs/mocha/actions?query=workflow%3ATests+branch%3Amaster"><img src="https://github.com/mochajs/mocha/workflows/Tests/badge.svg?branch=master" alt="GitHub Actions Build Status"></a>
<a href="https://coveralls.io/github/mochajs/mocha"><img src="https://coveralls.io/repos/github/mochajs/mocha/badge.svg" alt="Coverage Status"></a>
<a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=shield" alt="FOSSA Status"></a>
<a href="https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter"></a>
<a href="https://github.com/mochajs/mocha#sponsors"><img src="https://opencollective.com/mochajs/tiers/sponsors/badge.svg" alt="OpenCollective"></a>
<a href="https://github.com/mochajs/mocha#backers"><img src="https://opencollective.com/mochajs/tiers/backers/badge.svg" alt="OpenCollective"></a>
</p>

<p align="center">
<a href="https://www.npmjs.com/package/mocha"><img src="https://img.shields.io/npm/v/mocha.svg" alt="NPM Version"></a>
<a href="https://github.com/mochajs/mocha"><img src="https://img.shields.io/node/v/mocha.svg" alt="Node Version"></a>
</p>

<p align="center"><br><img alt="Mocha Browser Support h/t SauceLabs" src="https://saucelabs.com/browser-matrix/mochajs.svg" width="354"></p>
@@ -16,79 +27,33 @@
- [Code of Conduct](https://github.com/mochajs/mocha/blob/master/.github/CODE_OF_CONDUCT.md)
- [Contributing](https://github.com/mochajs/mocha/blob/master/.github/CONTRIBUTING.md)
- [Gitter Chatroom](https://gitter.im/mochajs/mocha) (ask questions here!)
- [Google Group](https://groups.google.com/group/mochajs)
- [Issue Tracker](https://github.com/mochajs/mocha/issues)

## Backers

[Become a backer](https://opencollective.com/mochajs#backer) and show your support to our open source project.

[![MochaJS Backer](https://opencollective.com/mochajs/backer/0/avatar)](https://opencollective.com/mochajs/backer/0/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/1/avatar)](https://opencollective.com/mochajs/backer/1/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/2/avatar)](https://opencollective.com/mochajs/backer/2/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/3/avatar)](https://opencollective.com/mochajs/backer/3/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/4/avatar)](https://opencollective.com/mochajs/backer/4/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/5/avatar)](https://opencollective.com/mochajs/backer/5/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/6/avatar)](https://opencollective.com/mochajs/backer/6/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/7/avatar)](https://opencollective.com/mochajs/backer/7/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/8/avatar)](https://opencollective.com/mochajs/backer/8/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/9/avatar)](https://opencollective.com/mochajs/backer/9/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/10/avatar)](https://opencollective.com/mochajs/backer/10/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/11/avatar)](https://opencollective.com/mochajs/backer/11/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/12/avatar)](https://opencollective.com/mochajs/backer/12/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/13/avatar)](https://opencollective.com/mochajs/backer/13/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/14/avatar)](https://opencollective.com/mochajs/backer/14/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/15/avatar)](https://opencollective.com/mochajs/backer/15/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/16/avatar)](https://opencollective.com/mochajs/backer/16/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/17/avatar)](https://opencollective.com/mochajs/backer/17/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/18/avatar)](https://opencollective.com/mochajs/backer/18/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/19/avatar)](https://opencollective.com/mochajs/backer/19/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/20/avatar)](https://opencollective.com/mochajs/backer/20/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/21/avatar)](https://opencollective.com/mochajs/backer/21/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/22/avatar)](https://opencollective.com/mochajs/backer/22/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/23/avatar)](https://opencollective.com/mochajs/backer/23/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/24/avatar)](https://opencollective.com/mochajs/backer/24/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/25/avatar)](https://opencollective.com/mochajs/backer/25/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/26/avatar)](https://opencollective.com/mochajs/backer/26/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/27/avatar)](https://opencollective.com/mochajs/backer/27/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/28/avatar)](https://opencollective.com/mochajs/backer/28/website)
[![MochaJS Backer](https://opencollective.com/mochajs/backer/29/avatar)](https://opencollective.com/mochajs/backer/29/website)
[Become a backer](https://opencollective.com/mochajs) and show your support to our open source project on [our site](https://mochajs.org/#backers).

<a href="https://opencollective.com/mochajs"><img src="https://opencollective.com/mochajs/tiers/backers.svg?limit=30&button=false&avatarHeight=46&width=750"></a>

## Sponsors

Does your company use Mocha? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Also, your company's logo will show [on GitHub](https://github.com/mochajs/mocha#readme) and on [our site](https://mochajs.org) - who doesn't want a little extra exposure? [Here's the info](https://opencollective.com/mochajs#sponsor).

[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/0/avatar)](https://opencollective.com/mochajs/sponsor/0/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/1/avatar)](https://opencollective.com/mochajs/sponsor/1/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/2/avatar)](https://opencollective.com/mochajs/sponsor/2/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/3/avatar)](https://opencollective.com/mochajs/sponsor/3/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/4/avatar)](https://opencollective.com/mochajs/sponsor/4/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/5/avatar)](https://opencollective.com/mochajs/sponsor/5/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/6/avatar)](https://opencollective.com/mochajs/sponsor/6/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/7/avatar)](https://opencollective.com/mochajs/sponsor/7/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/8/avatar)](https://opencollective.com/mochajs/sponsor/8/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/9/avatar)](https://opencollective.com/mochajs/sponsor/9/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/10/avatar)](https://opencollective.com/mochajs/sponsor/10/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/11/avatar)](https://opencollective.com/mochajs/sponsor/11/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/12/avatar)](https://opencollective.com/mochajs/sponsor/12/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/13/avatar)](https://opencollective.com/mochajs/sponsor/13/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/14/avatar)](https://opencollective.com/mochajs/sponsor/14/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/15/avatar)](https://opencollective.com/mochajs/sponsor/15/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/16/avatar)](https://opencollective.com/mochajs/sponsor/16/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/17/avatar)](https://opencollective.com/mochajs/sponsor/17/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/18/avatar)](https://opencollective.com/mochajs/sponsor/18/website)
[![MochaJS Backer](https://opencollective.com/mochajs/sponsor/19/avatar)](https://opencollective.com/mochajs/sponsor/19/website)
Does your company use Mocha? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Also, your company's logo will show [on GitHub](https://github.com/mochajs/mocha#readme) and on [our site](https://mochajs.org#sponsors) - who doesn't want a little extra exposure? [Here's the info](https://opencollective.com/mochajs).

[![MochaJS Sponsor](https://opencollective.com/mochajs/tiers/sponsors/0/avatar)](https://opencollective.com/mochajs/tiers/sponsors/0/website)
[![MochaJS Sponsor](https://opencollective.com/mochajs/tiers/sponsors/1/avatar)](https://opencollective.com/mochajs/tiers/sponsors/1/website)
[![MochaJS Sponsor](https://opencollective.com/mochajs/tiers/sponsors/2/avatar)](https://opencollective.com/mochajs/tiers/sponsors/2/website)
[![MochaJS Sponsor](https://opencollective.com/mochajs/tiers/sponsors/3/avatar)](https://opencollective.com/mochajs/tiers/sponsors/3/website)

## Development

You might want to know that:

- Mocha is the *most-depended-upon* module on npm (source: [libraries.io](https://libraries.io/search?order=desc&platforms=NPM&sort=dependents_count)), and
- Mocha is an *independent* open-source project, maintained exclusively by volunteers.
- Mocha is one of the _most-depended-upon_ modules on npm (source: [libraries.io](https://libraries.io/search?order=desc&platforms=NPM&sort=dependents_count)), and
- Mocha is an _independent_ open-source project, maintained exclusively by volunteers.

You might want to help:

- New to contributing to Mocha? Check out this list of [good first issues](https://github.com/mochajs/mocha/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue)
- New to contributing to Mocha? Check out this list of [good first issues](https://github.com/mochajs/mocha/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-issue)
- Mocha could use a hand with [these issues](https://github.com/mochajs/mocha/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
- The [maintainer's handbook](https://github.com/mochajs/mocha/blob/master/MAINTAINERS.md) explains how things get done

@@ -100,6 +65,6 @@ Finally, come [chat with the maintainers](https://gitter.im/mochajs/contributors

## License

[MIT](LICENSE)
Copyright 2011-2021 OpenJS Foundation and contributors. Licensed [MIT](https://github.com/mochajs/mocha/blob/master/LICENSE).

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_large)
77 changes: 0 additions & 77 deletions appveyor.yml

This file was deleted.

Binary file added assets/mocha-fixture-wizard.sketch
Binary file not shown.
111 changes: 49 additions & 62 deletions bin/mocha
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
* @private
*/

const {deprecate, warn} = require('../lib/utils');
const {loadOptions} = require('../lib/cli/options');
const {
unparseNodeFlags,
@@ -20,10 +19,10 @@ const {
const unparse = require('yargs-unparser');
const debug = require('debug')('mocha:cli:mocha');
const {aliases} = require('../lib/cli/run-option-metadata');
const nodeEnv = require('node-environment-flags');

const mochaArgs = {};
const nodeArgs = {};
let hasInspect = false;

const opts = loadOptions(process.argv.slice(2));
debug('loaded opts', opts);
@@ -35,10 +34,8 @@ debug('loaded opts', opts);
*/
const disableTimeouts = value => {
if (impliesNoTimeouts(value)) {
debug(`option "${value}" disabled timeouts`);
debug('option %s disabled timeouts', value);
mochaArgs.timeout = 0;
delete mochaArgs.timeouts;
delete mochaArgs.t;
}
};

@@ -55,81 +52,55 @@ const trimV8Option = value =>
Object.keys(opts).forEach(opt => {
if (isNodeFlag(opt)) {
nodeArgs[trimV8Option(opt)] = opts[opt];
disableTimeouts(opt);
} else {
mochaArgs[opt] = opts[opt];
}
});

// disable 'timeout' for debugFlags
Object.keys(nodeArgs).forEach(opt => disableTimeouts(opt));
mochaArgs['node-option'] &&
mochaArgs['node-option'].forEach(opt => disableTimeouts(opt));

// Native debugger handling
// see https://nodejs.org/api/debugger.html#debugger_debugger
// look for 'debug' or 'inspect' that would launch this debugger,
// look for 'inspect' that would launch this debugger,
// remove it from Mocha's opts and prepend it to Node's opts.
// also coerce depending on Node.js version.
// A deprecation warning will be printed by node, if applicable.
// (mochaArgs._ are "positional" arguments, not prefixed with - or --)
if (/^(debug|inspect)$/.test(mochaArgs._[0])) {
const command = mochaArgs._.shift();
disableTimeouts(command);
// don't conflict with inspector
['debug', 'inspect', 'debug-brk', 'inspect-brk']
.filter(opt => opt in nodeArgs || opt in mochaArgs)
.forEach(opt => {
warn(`command "${command}" provided; --${opt} ignored`);
delete nodeArgs[opt];
delete mochaArgs[opt];
});
nodeArgs._ = [
parseInt(
process.version
.slice(1)
.split('.')
.shift(),
10
) >= 8
? 'inspect'
: 'debug'
];
}

// allow --debug to invoke --inspect on Node.js v8 or newer.
['debug', 'debug-brk']
.filter(opt => opt in nodeArgs && !nodeEnv.has(opt))
.forEach(opt => {
const newOpt = opt === 'debug' ? 'inspect' : 'inspect-brk';
warn(
`"--${opt}" is not available in Node.js ${
process.version
}; use "--${newOpt}" instead.`
);
nodeArgs[newOpt] = nodeArgs[opt];
mochaArgs.timeout = false;
debug(`--${opt} -> ${newOpt}`);
delete nodeArgs[opt];
});

// historical
if (nodeArgs.gc) {
deprecate(
'"-gc" is deprecated and will be removed from a future version of Mocha. Use "--gc-global" instead.'
);
nodeArgs['gc-global'] = nodeArgs.gc;
delete nodeArgs.gc;
if (mochaArgs._) {
const i = mochaArgs._.findIndex(val => val === 'inspect');
if (i > -1) {
mochaArgs._.splice(i, 1);
disableTimeouts('inspect');
hasInspect = true;
}
}

if (Object.keys(nodeArgs).length) {
if (mochaArgs['node-option'] || Object.keys(nodeArgs).length || hasInspect) {
const {spawn} = require('child_process');
const mochaPath = require.resolve('../lib/cli/cli.js');

debug('final node args', nodeArgs);
const nodeArgv =
(mochaArgs['node-option'] && mochaArgs['node-option'].map(v => '--' + v)) ||
unparseNodeFlags(nodeArgs);

if (hasInspect) nodeArgv.unshift('inspect');
delete mochaArgs['node-option'];

debug('final node argv', nodeArgv);

const args = [].concat(
unparseNodeFlags(nodeArgs),
nodeArgv,
mochaPath,
unparse(mochaArgs, {alias: aliases})
);

debug(`exec ${process.execPath} w/ args:`, args);
debug(
'forking child process via command: %s %s',
process.execPath,
args.join(' ')
);

const proc = spawn(process.execPath, args, {
stdio: 'inherit'
@@ -147,9 +118,25 @@ if (Object.keys(nodeArgs).length) {

// terminate children.
process.on('SIGINT', () => {
proc.kill('SIGINT'); // calls runner.abort()
proc.kill('SIGTERM'); // if that didn't work, we're probably in an infinite loop, so make it die.
// XXX: a previous comment said this would abort the runner, but I can't see that it does
// anything with the default runner.
debug('main process caught SIGINT');
proc.kill('SIGINT');
// if running in parallel mode, we will have a proper SIGINT handler, so the below won't
// be needed.
if (!args.parallel || args.jobs < 2) {
// win32 does not support SIGTERM, so use next best thing.
if (require('os').platform() === 'win32') {
proc.kill('SIGKILL');
} else {
// using SIGKILL won't cleanly close the output streams, which can result
// in cut-off text or a befouled terminal.
debug('sending SIGTERM to child process');
proc.kill('SIGTERM');
}
}
});
} else {
require('../lib/cli/cli').main(unparse(mochaArgs, {alias: aliases}));
debug('running Mocha in-process');
require('../lib/cli/cli').main([], mochaArgs);
}
10 changes: 0 additions & 10 deletions bin/options.js

This file was deleted.

47 changes: 36 additions & 11 deletions browser-entry.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@

process.stdout = require('browser-stdout')({label: false});

var parseQuery = require('./lib/browser/parse-query');
var highlightTags = require('./lib/browser/highlight-tags');
var Mocha = require('./lib/mocha');

/**
@@ -52,6 +54,17 @@ process.removeListener = function(e, fn) {
}
};

/**
* Implements listenerCount for 'uncaughtException'.
*/

process.listenerCount = function(name) {
if (name === 'uncaughtException') {
return uncaughtExceptionHandlers.length;
}
return 0;
};

/**
* Implements uncaughtException listener.
*/
@@ -60,12 +73,19 @@ process.on = function(e, fn) {
if (e === 'uncaughtException') {
global.onerror = function(err, url, line) {
fn(new Error(err + ' (' + url + ':' + line + ')'));
return !mocha.allowUncaught;
return !mocha.options.allowUncaught;
};
uncaughtExceptionHandlers.push(fn);
}
};

process.listeners = function(e) {
if (e === 'uncaughtException') {
return uncaughtExceptionHandlers;
}
return [];
};

// The BDD UI is registered by default, but no UI will be functional in the
// browser without an explicit call to the overridden `mocha.ui` (see below).
// Ensure that this default UI does not expose its methods to the global scope.
@@ -128,11 +148,19 @@ mocha.setup = function(opts) {
if (typeof opts === 'string') {
opts = {ui: opts};
}
for (var opt in opts) {
if (opts.hasOwnProperty(opt)) {
this[opt](opts[opt]);
}
if (opts.delay === true) {
this.delay();
}
var self = this;
Object.keys(opts)
.filter(function(opt) {
return opt !== 'delay';
})
.forEach(function(opt) {
if (Object.prototype.hasOwnProperty.call(opts, opt)) {
self[opt](opts[opt]);
}
});
return this;
};

@@ -144,7 +172,7 @@ mocha.run = function(fn) {
var options = mocha.options;
mocha.globals('location');

var query = Mocha.utils.parseQuery(global.location.search || '');
var query = parseQuery(global.location.search || '');
if (query.grep) {
mocha.grep(query.grep);
}
@@ -163,7 +191,7 @@ mocha.run = function(fn) {
document.getElementById('mocha') &&
options.noHighlighting !== true
) {
Mocha.utils.highlightTags('code');
highlightTags('code');
}
if (fn) {
fn(err);
@@ -185,7 +213,4 @@ Mocha.process = process;
global.Mocha = Mocha;
global.mocha = mocha;

// this allows test/acceptance/required-tokens.js to pass; thus,
// you can now do `const describe = require('mocha').describe` in a
// browser context (assuming browserification). should fix #880
module.exports = global;
module.exports = mocha;
4 changes: 4 additions & 0 deletions docs/.eleventyignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,7 @@ LICENSE*
.*
_dist/
example/
changelogs/
api-tutorials/
_site/

5 changes: 2 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Mocha's API Documentation

* * *
---

Congratulations! You've found Mocha's API documentation. These docs are for developers who wish to:
Congratulations! You've found Mocha's API documentation. These docs are for developers who wish to:

- Create an extension for Mocha, or
- Develop Mocha itself, or
@@ -16,5 +16,4 @@ Otherwise, **you probably want the [main documentation](https://mochajs.org)**.
- **[Release Notes / History / Changes](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)**
- [Code of Conduct](https://github.com/mochajs/mocha/blob/master/.github/CODE_OF_CONDUCT.md)
- [Gitter Chatroom](https://gitter.im/mochajs/mocha) (ask questions here!)
- [Google Group](https://groups.google.com/group/mochajs)
- [Issue Tracker](https://github.com/mochajs/mocha/issues)
19 changes: 17 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ _So you wanna build the site?_

## Prerequisites

- Node.js v6.x or greater
- Node.js v10.12.0 or greater

## Development

@@ -19,7 +19,22 @@ _So you wanna build the site?_
- The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc.
- This file (`docs/README.md`) should _not_ be included in the build.
- `docs/_dist` is where the deployed site lives. `docs/_site` is essentially a build step. These directories are _not_ under version control.
- See `package-scripts.js` for details on what the builds are actually doing; especially see [markdown-magic](https://npm.im/markdown-magic) for how we're dynamically inserting information into `docs/index.md`.
- If you get the error message below when running `npm start docs`, follow [this guide](https://www.npmjs.com/package/gm) to install GraphicsMagick or ImageMagick.

```console
⚠ WARN: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
(node:45255) UnhandledPromiseRejectionWarning: Error: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
at Socket.stdout.on.once (/Users/username/mocha/node_modules/express-processimage/lib/getFilterInfosAndTargetContentTypeFromQueryString.js:821:31)
at Object.onceWrapper (events.js:286:20)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:45255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:45255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cp: docs/_dist/_headers: No such file or directory
```

- See `package-scripts.js` for details on what the builds are actually doing.

## License

18 changes: 18 additions & 0 deletions docs/_data/blocklist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
"cheap-writing-service",
"coin-master-free-spins",
"cyberflix-tv",
"device-tricks1",
"domywriting",
"emailmarketingservices-io",
"hurtiglaan-nu",
"igor-noskov",
"mochajs",
"my-true-media",
"open-apk-file",
"thetoy",
"trust-my-paper",
"writemypaper4me",
"writerseperhour",
"yiannakis-ttafounas-ttafounas"
]
48 changes: 48 additions & 0 deletions docs/_data/files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';

const {resolve, relative, dirname} = require('path');
const {promises: fs} = require('fs');

const PROJECT_ROOT_DIR = resolve(__dirname, '..', '..');
const FILES = [
{
slug: 'simplereporter',
path: require.resolve('../../test/integration/fixtures/simple-reporter.js'),
header: '// my-reporter.js'
}
];

const loadFile = async (path, {header} = {}) => {
const relativeDir = relative(dirname(path), PROJECT_ROOT_DIR);
let content = await fs.readFile(path, 'utf-8');
// replace relative paths in `require()` to root with "mocha".
// might not work in the general case. not gonna parse an AST for this
// e.g. `require('../../lib/foo')` => `require('mocha/lib/foo')`
// also trim any trailing whitespace
content = content
.replace(
new RegExp(`require\\(['"]${relativeDir}(.*?)['"]\\)`, 'g'),
"require('mocha$1')"
)
.trim();
return `${header}\n\n${content}`;
};

/**
* Loads files from disk (see `FILES` above) to be shown as data.
* Used for embedding sources directly into pages
*/
module.exports = async () => {
const files = [];
for await (const {path, header, slug} of FILES) {
const content = await loadFile(path, {header});
files.push({slug, content});
}
return files.reduce(
(files, {slug, content}) => ({
...files,
[slug]: content
}),
{}
);
};
289 changes: 289 additions & 0 deletions docs/_data/supporters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
#!/usr/bin/env node

/**
* This script gathers metadata for active supporters of Mocha from OpenCollective's
* API by aggregating order ("donation") information.
*
* It's intended to be used with 11ty, but can be run directly. Running directly
* enables debug output.
*
* - gathers logo/avatar images (they are always pngs)
* - gathers links
* - sorts by tier and total contributions
* - validates images
* - writes images to a temp dir
* @see https://docs.opencollective.com/help/contributing/development/api
*/

'use strict';

const {loadImage} = require('canvas');
const {writeFile, mkdir, rmdir} = require('fs').promises;
const {resolve} = require('path');
const debug = require('debug')('mocha:docs:data:supporters');
const needle = require('needle');
const blocklist = new Set(require('./blocklist.json'));

/**
* In addition to the blocklist, any account slug matching this regex will not
* be displayed on the website.
*/
const BLOCKED_STRINGS = /(?:[ck]a[sz]ino|seo|slots|gambl(?:e|ing)|crypto)/i;

/**
* Add a few Categories exposed by Open Collective to help moderation
*/
const BLOCKED_CATEGORIES = [
'adult',
'casino',
'credit',
'gambling',
'seo',
'writer'
];

/**
* The OC API endpoint
*/
const API_ENDPOINT = 'https://api.opencollective.com/graphql/v2';

const SPONSOR_TIER = 'sponsors';
const BACKER_TIER = 'backers';

// if this percent of fetches completes, the build will pass
const PRODUCTION_SUCCESS_THRESHOLD = 0.8;

const SUPPORTER_IMAGE_PATH = resolve(__dirname, '../images/supporters');

const SUPPORTER_QUERY = `query account($limit: Int, $offset: Int, $slug: String) {
account(slug: $slug) {
orders(limit: $limit, offset: $offset, status: ACTIVE, filter: INCOMING) {
limit
offset
totalCount
nodes {
fromAccount {
id
name
slug
website
imgUrlMed: imageUrl(height:64)
imgUrlSmall: imageUrl(height:32)
type
categories
}
tier { slug }
totalDonations { value }
createdAt
}
}
}
}`;

const GRAPHQL_PAGE_SIZE = 1000;

const invalidSupporters = [];

const nodeToSupporter = node => ({
id: node.fromAccount.id,
name: node.fromAccount.name,
slug: node.fromAccount.slug,
website: node.fromAccount.website,
imgUrlMed: node.fromAccount.imgUrlMed,
imgUrlSmall: node.fromAccount.imgUrlSmall,
type: node.fromAccount.type,
categories: node.fromAccount.categories,
tier: (node.tier && node.tier.slug) || BACKER_TIER,
totalDonations: node.totalDonations.value * 100,
firstDonation: node.createdAt
});

const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD
? async supporter => {
invalidSupporters.push(supporter);
}
: async supporter => {
try {
const {avatar: url} = supporter;
const {body: imageBuf, headers} = await needle('get', url, {
timeout: 2000
});
if (headers['content-type'].startsWith('text/html')) {
throw new TypeError(
'received html and expected a png; outage likely'
);
}
debug('fetched %s', url);
const canvasImage = await loadImage(imageBuf);
debug('ok %s', url);
supporter.dimensions = {
width: canvasImage.width,
height: canvasImage.height
};
// debug('dimensions %s %dw %dh', url, canvasImage.width, canvasImage.height);
const filePath = resolve(SUPPORTER_IMAGE_PATH, supporter.id + '.png');
await writeFile(filePath, imageBuf);
debug('wrote %s', filePath);
} catch (err) {
console.error(
`failed to load ${supporter.avatar}; will discard ${supporter.tier} "${supporter.name} (${supporter.slug}). reason:\n`,
err
);
invalidSupporters.push(supporter);
}
};

/**
* Retrieves donation data from OC
*
* Handles pagination
* @param {string} slug - Collective slug to get donation data from
* @returns {Promise<Object[]>} Array of raw donation data
*/
const getAllOrders = async (slug = 'mochajs') => {
let allOrders = [];
const variables = {limit: GRAPHQL_PAGE_SIZE, offset: 0, slug};

// Handling pagination if necessary (2 pages for ~1400 results in May 2019)
while (true) {
const result = await needle(
'post',
API_ENDPOINT,
{query: SUPPORTER_QUERY, variables},
{json: true}
);
const orders = result.body.data.account.orders.nodes;
allOrders = [...allOrders, ...orders];
variables.offset += GRAPHQL_PAGE_SIZE;
if (orders.length < GRAPHQL_PAGE_SIZE) {
debug('retrieved %d orders', allOrders.length);
return allOrders;
} else {
debug(
'loading page %d of orders...',
Math.floor(variables.offset / GRAPHQL_PAGE_SIZE)
);
}
}
};

const isAllowed = ({slug, categories}) =>
!blocklist.has(slug) &&
!BLOCKED_STRINGS.test(slug) &&
!categories.some(category => BLOCKED_CATEGORIES.includes(category));

const getSupporters = async () => {
const orders = await getAllOrders();
// Deduplicating supporters with multiple orders
const uniqueSupporters = new Map();

const supporters = orders
// turn raw query result into a better data structure
.map(nodeToSupporter)
// aggregate total $ donated by unique supporter (using slug)
.reduce((supporters, supporter) => {
if (uniqueSupporters.has(supporter.slug)) {
uniqueSupporters.get(supporter.slug).totalDonations +=
supporter.totalDonations;
return supporters;
}
uniqueSupporters.set(supporter.slug, supporter);
return [...supporters, supporter];
}, [])
// discard spammy supporters
.filter(isAllowed)
// sort by total $ donated, descending
.sort((a, b) => b.totalDonations - a.totalDonations)
// determine which url to use depending on tier
.reduce(
(supporters, supporter) => {
if (supporter.tier === BACKER_TIER) {
if (supporter.name !== 'anonymous') {
supporters[BACKER_TIER] = [
...supporters[BACKER_TIER],
{
...supporter,
avatar: encodeURI(supporter.imgUrlSmall)
}
];
}
} else {
supporters[SPONSOR_TIER] = [
...supporters[SPONSOR_TIER],
{
...supporter,
avatar: encodeURI(supporter.imgUrlMed)
}
];
}
return supporters;
},
{
[SPONSOR_TIER]: [],
[BACKER_TIER]: []
}
);

await rmdir(SUPPORTER_IMAGE_PATH, {recursive: true});
debug('blasted %s', SUPPORTER_IMAGE_PATH);
await mkdir(SUPPORTER_IMAGE_PATH, {recursive: true});
debug('created %s', SUPPORTER_IMAGE_PATH);

// Fetch images for sponsors and save their image dimensions
await Promise.all([
...supporters[SPONSOR_TIER].map(fetchImage),
...supporters[BACKER_TIER].map(fetchImage)
]);
debug('fetched images');

invalidSupporters.forEach(supporter => {
supporters[supporter.tier].splice(
supporters[supporter.tier].indexOf(supporter),
1
);
});
debug('tossed out invalid supporters');

const backerCount = supporters[BACKER_TIER].length;
const sponsorCount = supporters[SPONSOR_TIER].length;
const totalValidSupportersCount = backerCount + sponsorCount;
const successRate = totalValidSupportersCount / invalidSupporters.length;

debug(
'found %d valid backers and %d valid sponsors (%d total; %d invalid; %d blocked)',
backerCount,
sponsorCount,
totalValidSupportersCount,
invalidSupporters.length,
uniqueSupporters.size - totalValidSupportersCount
);

if (successRate < PRODUCTION_SUCCESS_THRESHOLD) {
if (process.env.NETLIFY && process.env.CONTEXT !== 'deploy-preview') {
throw new Error(
`Failed to meet success threshold ${PRODUCTION_SUCCESS_THRESHOLD *
100}% (was ${successRate *
100}%) for a production deployment; refusing to deploy`
);
} else {
console.warn(
`WARNING: Success rate of ${successRate *
100}% fails to meet production threshold of ${PRODUCTION_SUCCESS_THRESHOLD *
100}%; would fail a production deployment!`
);
}
}
debug('supporter image pull completed');
return supporters;
};

module.exports = getSupporters;

if (require.main === module) {
require('debug').enable('mocha:docs:data:supporters');
process.on('unhandledRejection', err => {
throw err;
});
getSupporters();
}
21 changes: 21 additions & 0 deletions docs/_data/toc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

const markdownToc = require('markdown-toc');
const {readFileSync} = require('fs');
const {resolve} = require('path');

const IGNORED_HEADINGS_REGEXP = /Features|Table of Contents|Backers|Sponsors/i;
const DOCUMENT_PATH = resolve(__dirname, '..', 'index.md');

module.exports = () => {
const doc = readFileSync(DOCUMENT_PATH, 'utf-8');
return markdownToc(doc, {
slugify: require('uslug'),
firsth1: false,
bullets: '-',
maxdepth: 2,
// if filter is supplied, maxdepth is apparently ignored,
// so we have to do it ourselves.
filter: (str, ele) => ele.lvl < 2 && !IGNORED_HEADINGS_REGEXP.test(str)
}).content;
};
21 changes: 21 additions & 0 deletions docs/_data/usage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

const stripAnsi = require('strip-ansi');
const {resolve} = require('path');
const {execSync} = require('child_process');

const executable = require.resolve('../../bin/mocha');
const flag = '--help';

/**
* Return the output of `mocha --help` for display
*/
module.exports = () => {
return stripAnsi(
String(
execSync(`"${process.execPath}" ${executable} ${flag}`, {
cwd: resolve(__dirname, '..')
})
).trim()
);
};
7 changes: 0 additions & 7 deletions docs/_includes/backers.md

This file was deleted.

69 changes: 0 additions & 69 deletions docs/_includes/default.html

This file was deleted.

170 changes: 170 additions & 0 deletions docs/_includes/default.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>{{ title }}</title>
<link rel="stylesheet" href="/css/normalize.css" />
<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/supporters.css" />
<link rel="stylesheet" href="/css/prism.css" />
<link rel="icon" href="favicon.ico" />

<!--[if lt IE 9]> <script src="js/html5shiv.min.js"></script> <![endif]-->
</head>

<body>
<header id="_header">
<h1>
<a href="/">
<img id="mocha-logo" loading="eager" src="/images/mocha-logo.svg" alt="Mocha logo" />
</a>
</h1>
<p id="tag"><em>simple</em>, <em>flexible</em>, <em>fun</em></p>
</header>

<main id="content">{{ content }}</main>

<aside class="sponsorship">
<a
href="https://matomo.org/"
rel="external noopener"
title="Mocha is sponsored by Matomo"
>
<img src="images/matomo-logo.png?trim" loading="lazy" alt="Matomo logo" />
</a>
<a
title="Mocha is an OpenJS Foundation Project"
href="https://openjsf.org"
rel="external noopener"
>
<img
src="/images/openjsf-logo.svg"
loading="lazy"
width="300"
height="94"
alt="OpenJS Foundation Logo"
/>
</a>
<a
href="https://wallabyjs.com"
rel="external noopener"
title="Mocha is sponsored by Wallaby"
>
<figure id="wallaby-logo">
<img src="images/wallaby-logo.png" loading="lazy" alt="Wallaby logo" />
<figcaption>Wallaby</figcaption>
</figure>
</a>
</aside>

<footer>
<div id="copyright-notice">
<a rel="home" href="https://mochajs.org/">mochajs.org</a> is licensed
under a
<a
rel="license external noopener"
href="https://creativecommons.org/licenses/by/4.0/"
>Creative Commons Attribution 4.0 International License</a
>.

<p>
Copyright
<a href="https://openjsf.org" rel="external noopener"
>OpenJS Foundation</a
>
and Mocha contributors. All rights reserved. The
<a href="https://openjsf.org" rel="external noopener"
>OpenJS Foundation</a
>
has registered trademarks and uses trademarks. For a list of
trademarks of the
<a href="https://openjsf.org" rel="external noopener"
>OpenJS Foundation</a
>, please see our
<a
href="https://trademark-policy.openjsf.org/"
rel="external noopener"
>Trademark Policy</a
>
and
<a href="https://trademark-list.openjsf.org/" rel="external noopener"
>Trademark List</a
>. Trademarks and logos not indicated on the
<a href="https://trademark-list.openjsf.org" rel="external noopener"
>list of OpenJS Foundation trademarks</a
>
are trademarks™ or registered® trademarks of their respective holders.
Use of them does not imply any affiliation with or endorsement by
them.
</p>
</div>

<div id="external-links">
<ul id="openjsf-links">
<li>
<a href="https://openjsf.org/" rel="external noopener"
>The OpenJS Foundation</a
>
</li>
<li>
<a href="https://terms-of-use.openjsf.org/" rel="external noopener"
>Terms of Use</a
>
</li>
<li>
<a
href="https://privacy-policy.openjsf.org/"
rel="external noopener"
>Privacy Policy</a
>
</li>
<li>
<a href="https://bylaws.openjsf.org/" rel="external noopener"
>OpenJS Foundation Bylaws</a
>
</li>
<li>
<a
href="https://trademark-policy.openjsf.org/"
rel="external noopener"
>Trademark Policy</a
>
</li>
<li>
<a
href="https://trademark-list.openjsf.org/"
rel="external noopener"
>Trademark List</a
>
</li>
<li>
<a
href="https://www.linuxfoundation.org/cookies/"
rel="external noopener"
>Cookie Policy</a
>
</li>
</ul>
<div class="netlify-badge">
<a href="https://www.netlify.com">
<img
src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" loading="lazy"
/>
</a>
</div>
</div>
<dl id="last-modified" class="dl-inline">
<dt>Last updated</dt>
<dd>
<time
itemprop="lastModified"
datetime="{{ 'now' | date: '%Y-%m-%dT%H:%M:%SZ' }}"
>
{{ 'now' | date: '%a %b %d %H:%M:%S %Y' }}
</time>
</dd>
</dl>
</footer>
</body>
</html>
436 changes: 436 additions & 0 deletions docs/_includes/fixture-wizard.html

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions docs/_includes/sponsors.md

This file was deleted.

35 changes: 35 additions & 0 deletions docs/_includes/supporters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Sponsors

Use Mocha at Work? Ask your manager or marketing team if they'd help [support](https://opencollective.com/mochajs#support) our project. Your company's logo will also be displayed on [npmjs.com](http://npmjs.com/package/mocha) and our [GitHub repository](https://github.com/mochajs/mocha#sponsors).

<ul class="image-list" id="sponsors">
{%- for supporter in supporters.sponsors -%}
<li>
{%- if supporter.website -%}
<a href="{{ supporter.website }}" target="_blank" rel="noopener">
{%- endif -%}
<div class="sponsor" title="{{ supporter.name }}" style="width: {{ supporter.dimensions.width }}px; background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
{%- if supporter.website -%}
</a>
{%- endif -%}
</li>
{%- endfor -%}
</ul>

## Backers

Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation.

<ul class="image-list faded-images" id="backers">
{%- for supporter in supporters.backers -%}
<li>
{%- if supporter.website -%}
<a href="{{ supporter.website }}" target="_blank" rel="noopener">
{%- endif -%}
<div class="backer backer-{{ forloop.index }}" title="{{ supporter.name }}" style="background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=backers)"></div>
{%- if supporter.website -%}
</a>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
113 changes: 23 additions & 90 deletions docs/api-tutorials/custom-reporter.md
Original file line number Diff line number Diff line change
@@ -6,115 +6,48 @@ For example, if `mocha-foo-reporter` was published to the npm registry, you coul

If you're looking to get started quickly, here's an example of a custom reporter:

<!-- AUTO-GENERATED-CONTENT:START (file:src=../../test/integration/fixtures/simple-reporter.js&header=// my-reporter.js)' -->

<!-- prettier-ignore -->
```js
// my-reporter.js
'use strict';

const Mocha = require('mocha');
const {
EVENT_RUN_BEGIN,
EVENT_RUN_END,
EVENT_TEST_FAIL,
EVENT_TEST_PASS,
EVENT_SUITE_BEGIN,
EVENT_SUITE_END
} = Mocha.Runner.constants;

// this reporter outputs test results, indenting two spaces per suite
class MyReporter {
constructor(runner) {
this._indents = 0;
const stats = runner.stats;

runner
.once(EVENT_RUN_BEGIN, () => {
console.log('start');
})
.on(EVENT_SUITE_BEGIN, () => {
this.increaseIndent();
})
.on(EVENT_SUITE_END, () => {
this.decreaseIndent();
})
.on(EVENT_TEST_PASS, test => {
// Test#fullTitle() returns the suite name(s)
// prepended to the test title
console.log(`${this.indent()}pass: ${test.fullTitle()}`);
})
.on(EVENT_TEST_FAIL, (test, err) => {
console.log(
`${this.indent()}fail: ${test.fullTitle()} - error: ${err.message}`
);
})
.once(EVENT_RUN_END, () => {
console.log(`end: ${stats.passes}/${stats.passes + stats.failures} ok`);
});
}

indent() {
return Array(this._indents).join(' ');
}

increaseIndent() {
this._indents++;
}

decreaseIndent() {
this._indents--;
}
}

module.exports = MyReporter;
{{ files.simplereporter }}
```

<!-- AUTO-GENERATED-CONTENT:END -->

To use this reporter, execute `mocha --reporter /path/to/my-reporter.js`.

For further examples, the built-in reporter implementations are the [best place to look](https://github.com/mochajs/mocha/tree/master/lib/reporters). The [integration tests](https://github.com/mochajs/mocha/tree/master/test/reporters) may also be helpful.

## The `Base` Reporter Class

[Base] is an "abstract" class. It contains console-specific settings and utilities, commonly used by built-in reporters. Browsing the built-in reporter implementations, you may often see static properties of [Base] referenced.
[Base]{@link Mocha.reporters.Base} is an "abstract" class. It contains console-specific settings and utilities, commonly used by built-in reporters. Browsing the built-in reporter implementations, you may often see static properties of [Base]{@link Mocha.reporters.Base} referenced.

It's often useful--but not necessary--for a custom reporter to extend [Base].
It's often useful--but not necessary--for a custom reporter to extend [Base]{@link Mocha.reporters.Base}.

## Statistics

Mocha adds a `stats` property of type [StatsCollector](/api/module-lib_stats-collector.html) to the reporter's `Runner` instance (passed as first argument to constructor).
Mocha adds a `stats` property of type {@link StatsCollector} to the reporter's `Runner` instance (passed as first argument to constructor).

## Events

A reporter should listen for events emitted from the `runner` (a singleton instance of [Runner]).
A reporter should listen for events emitted from the `runner` (a singleton instance of {@link Runner}).

The event names are exported from the `constants` property of `Mocha.Runner`:

| Constant | Event Name | Event Arguments | Description |
| -------------------- | ----------- | --------------- | ------------------------------------------------------------------------------------------- |
| `EVENT_RUN_BEGIN` | `start` | _(n/a)_ | Execution will begin. |
| `EVENT_RUN_END` | `end` | _(n/a)_ | All [Suite]s, [Test]s and [Hook]s have completed execution. |
| `EVENT_DELAY_BEGIN` | `waiting` | _(n/a)_ | Waiting for `global.run()` to be called; only emitted when [delay] option is `true`. |
| `EVENT_DELAY_END` | `ready` | _(n/a)_ | User called `global.run()` and the root suite is ready to execute. |
| `EVENT_SUITE_BEGIN` | `suite` | `Suite` | The [Hook]s and [Test]s within a [Suite] will be executed, including any nested [Suite]s. |
| `EVENT_SUITE_END` | `suite end` | `Suite` | The [Hook]s, [Test]s, and nested [Suite]s within a [Suite] have completed execution. |
| `EVENT_HOOK_BEGIN` | `hook` | `Hook` | A [Hook] will be executed. |
| `EVENT_HOOK_END` | `hook end` | `Hook` | A [Hook] has completed execution. |
| `EVENT_TEST_BEGIN` | `test` | `Test` | A [Test] will be executed. |
| `EVENT_TEST_END` | `test end` | `Test` | A [Test] has completed execution. |
| `EVENT_TEST_FAIL` | `fail` | `Test`, `Error` | A [Test] has failed or thrown an exception. |
| `EVENT_TEST_PASS` | `pass` | `Test` | A [Test] has passed. |
| `EVENT_TEST_PENDING` | `pending` | `Test` | A [Test] was skipped. |
| `EVENT_TEST_RETRY` | `retry` | `Test`, `Error` | A [Test] failed, but is about to be retried; only emitted if the `retry` option is nonzero. |
| Constant | Event Name | Event Arguments | Description |
| -------------------- | ----------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `EVENT_RUN_BEGIN` | `start` | _(n/a)_ | Execution will begin. |
| `EVENT_RUN_END` | `end` | _(n/a)_ | All [Suites]{@link Suite}, [Tests]{@link Test} and [Hooks]{@link Hook} have completed execution. |
| `EVENT_DELAY_BEGIN` | `waiting` | _(n/a)_ | Waiting for `global.run()` to be called; only emitted when [delay](/#delayed-root-suite) option is `true`. |
| `EVENT_DELAY_END` | `ready` | _(n/a)_ | User called `global.run()` and the root suite is ready to execute. |
| `EVENT_SUITE_BEGIN` | `suite` | `Suite` | The [Hooks]{@link Hook} and [Tests]{@link Test} within a {@link Suite} will be executed, including any nested [Suites]{@link Suite}. |
| `EVENT_SUITE_END` | `suite end` | `Suite` | The [Hooks]{@link Hook}, [Tests]{@link Test}, and nested [Suites]{@link Suite} within a {@link Suite} have completed execution. |
| `EVENT_HOOK_BEGIN` | `hook` | `Hook` | A {@link Hook} will be executed. |
| `EVENT_HOOK_END` | `hook end` | `Hook` | A {@link Hook} has completed execution. |
| `EVENT_TEST_BEGIN` | `test` | `Test` | A {@link Test} will be executed. |
| `EVENT_TEST_END` | `test end` | `Test` | A {@link Test} has completed execution. |
| `EVENT_TEST_FAIL` | `fail` | `Test`, `Error` | A {@link Test} has failed or thrown an exception. |
| `EVENT_TEST_PASS` | `pass` | `Test` | A {@link Test} has passed. |
| `EVENT_TEST_PENDING` | `pending` | `Test` | A {@link Test} was skipped. |
| `EVENT_TEST_RETRY` | `retry` | `Test`, `Error` | A {@link Test} failed, but is about to be retried; only emitted if the `retry` option is nonzero. |

**Please use these constants** instead of the event names in your own reporter! This will ensure compatibility with future versions of Mocha.

> It's important to understand that all `Suite` callbacks will be run _before_ the [Runner] emits `EVENT_RUN_BEGIN`. Hooks and tests, however, won't run until _after_ the [Runner] emits `EVENT_RUN_BEGIN`.
[runner]: /api/runner.html
[test]: /api/test.html
[hook]: /api/hook.html
[suite]: /api/suite.html
[base]: /api/mocha.reporters.base.html
[delay]: /#delayed-root-suite.html
> It's important to understand that all `Suite` callbacks will be run _before_ the {@link Runner} emits `EVENT_RUN_BEGIN`. Hooks and tests won't run until _after_ the {@link Runner} emits `EVENT_RUN_BEGIN`.
1,258 changes: 1,258 additions & 0 deletions docs/changelogs/CHANGELOG_V3_older.md

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions docs/changelogs/CHANGELOG_V4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 4.1.0 / 2017-12-28

This is mainly a "housekeeping" release.

Welcome [@Bamieh](https://github.com/Bamieh) and [@xxczaki](https://github.com/xxczaki) to the team!

## :bug: Fixes

- [#2661](https://github.com/mochajs/mocha/issues/2661): `progress` reporter now accepts reporter options ([@canoztokmak](https://github.com/canoztokmak))
- [#3142](https://github.com/mochajs/mocha/issues/3142): `xit` in `bdd` interface now properly returns its `Test` object ([@Bamieh](https://github.com/Bamieh))
- [#3075](https://github.com/mochajs/mocha/pull/3075): Diffs now computed eagerly to avoid misinformation when reported ([@abrady0](https://github.com/abrady0))
- [#2745](https://github.com/mochajs/mocha/issues/2745): `--help` will now help you even if you have a `mocha.opts` ([@Zarel](https://github.com/Zarel))

## :tada: Enhancements

- [#2514](https://github.com/mochajs/mocha/issues/2514): The `--no-diff` flag will completely disable diff output ([@CapacitorSet](https://github.com/CapacitorSet))
- [#3058](https://github.com/mochajs/mocha/issues/3058): All "setters" in Mocha's API are now also "getters" if called without arguments ([@makepanic](https://github.com/makepanic))

## :book: Documentation

- [#3170](https://github.com/mochajs/mocha/pull/3170): Optimization and site speed improvements ([@Munter](https://github.com/munter))
- [#2987](https://github.com/mochajs/mocha/issues/2987): Moved the old [site repo](https://github.com/mochajs/mochajs.github.io) into the main repo under `docs/` ([@boneskull](https://github.com/boneskull))
- [#2896](https://github.com/mochajs/mocha/issues/2896): Add [maintainer guide](https://github.com/mochajs/mocha/blob/master/MAINTAINERS.md) ([@boneskull](https://github.com/boneskull))
- Various fixes and updates ([@xxczaki](https://github.com/xxczaki), [@maty21](https://github.com/maty21), [@leedm777](https://github.com/leedm777))

## :nut_and_bolt: Other

- Test improvements and fixes ([@eugenet8k](https://github.com/eugenet8k), [@ngeor](https://github.com/ngeor), [@38elements](https://github.com/38elements), [@Gerhut](https://github.com/Gerhut), [@ScottFreeCode](https://github.com/ScottFreeCode), [@boneskull](https://github.com/boneskull))
- Refactoring and cruft excision ([@38elements](https://github.com/38elements), [@Bamieh](https://github.com/Bamieh), [@finnigantime](https://github.com/finnigantime), [@boneskull](https://github.com/boneskull))

# 4.0.1 / 2017-10-05

## :bug: Fixes

- [#3051](https://github.com/mochajs/mocha/pull/3051): Upgrade Growl to v1.10.3 to fix its [peer dep problems](https://github.com/tj/node-growl/pull/68) ([@dpogue](https://github.com/dpogue))

# 4.0.0 / 2017-10-02

You might want to read this before filing a new bug! :stuck_out_tongue_closed_eyes:

## :boom: Breaking Changes

For more info, please [read this article](https://boneskull.com/mocha-v4-nears-release/).

### Compatibility

- [#3016](https://github.com/mochajs/mocha/issues/3016): Drop support for unmaintained versions of Node.js ([@boneskull](https://github.com/boneskull)):
- 0.10.x
- 0.11.x
- 0.12.x
- iojs (any)
- 5.x.x
- [#2979](https://github.com/mochajs/mocha/issues/2979): Drop support for non-ES5-compliant browsers ([@boneskull](https://github.com/boneskull)):
- IE7
- IE8
- PhantomJS 1.x
- [#2615](https://github.com/mochajs/mocha/issues/2615): Drop Bower support; old versions (3.x, etc.) will remain available ([@ScottFreeCode](https://github.com/ScottFreeCode), [@boneskull](https://github.com/boneskull))

### Default Behavior

- [#2879](https://github.com/mochajs/mocha/issues/2879): By default, Mocha will no longer force the process to exit once all tests complete. This means any test code (or code under test) which would normally prevent `node` from exiting will do so when run in Mocha. Supply the `--exit` flag to revert to pre-v4.0.0 behavior ([@ScottFreeCode](https://github.com/ScottFreeCode), [@boneskull](https://github.com/boneskull))

### Reporter Output

- [#2095](https://github.com/mochajs/mocha/issues/2095): Remove `stdout:` prefix from browser reporter logs ([@skeggse](https://github.com/skeggse))
- [#2295](https://github.com/mochajs/mocha/issues/2295): Add separator in "unified diff" output ([@olsonpm](https://github.com/olsonpm))
- [#2686](https://github.com/mochajs/mocha/issues/2686): Print failure message when `--forbid-pending` or `--forbid-only` is specified ([@ScottFreeCode](https://github.com/ScottFreeCode))
- [#2814](https://github.com/mochajs/mocha/pull/2814): Indent contexts for better readability when reporting failures ([@charlierudolph](https://github.com/charlierudolph))

## :-1: Deprecations

- [#2493](https://github.com/mochajs/mocha/issues/2493): The `--compilers` command-line option is now soft-deprecated and will emit a warning on `STDERR`. Read [this](https://github.com/mochajs/mocha/wiki/compilers-deprecation) for more info and workarounds ([@ScottFreeCode](https://github.com/ScottFreeCode), [@boneskull](https://github.com/boneskull))

## :tada: Enhancements

- [#2628](https://github.com/mochajs/mocha/issues/2628): Allow override of default test suite name in XUnit reporter ([@ngeor](https://github.com/ngeor))

## :book: Documentation

- [#3020](https://github.com/mochajs/mocha/pull/3020): Link to CLA in `README.md` and `CONTRIBUTING.md` ([@skeggse](https://github.com/skeggse))

## :nut_and_bolt: Other

- [#2890](https://github.com/mochajs/mocha/issues/2890): Speed up build by (re-)consolidating SauceLabs tests ([@boneskull](https://github.com/boneskull))
7 changes: 7 additions & 0 deletions docs/changelogs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Historical Changelogs

These are changelogs for (very) old versions of Mocha.

These changelogs are _not_ included in the website, and are here only for archival purposes.

_If you're looking for the current changelog, [here is the current changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)._
209 changes: 177 additions & 32 deletions docs/css/style.css
Original file line number Diff line number Diff line change
@@ -74,32 +74,57 @@ nav.badges a + a {
margin-left: 3px;
}

.image-list {
ul.image-list {
overflow: hidden;
text-align: center;
list-style: none;
column-count: 1;
padding: 0;
margin: 0;
}

.image-list a {
float: left;
margin: 6px;
ul.image-list li {
border-bottom: none;
display: inline-block;
margin: 0 4px 0 4px;
max-height: 64px;
padding: 0;
line-height: 0;
}

.image-list a img {
ul.image-list li a {
display: inline-block;
}

ul.image-list li img {
margin: 0;
padding: 0;
display: block;
height: 64px;
max-height: 64px;
}

.faded-images img {
opacity: 0;
transition: opacity 0.3s;
ul#backers.image-list li img {
width: 32px;
height: 32px;
overflow: hidden;
}

.faded-images.is-loaded img {
opacity: 1;
.faded-image {
background-color: rgba(0, 0, 0, 0.05);
}

.faded-image.is-loaded {
background-color: rgba(0, 0, 0, 0);
transition: background-color 0.3s;
}

#_backers a img {
background: url(/images/backer-background.svg?inline) center center no-repeat;
width: 64px;
.faded-image img {
opacity: 0;
transition: opacity 0.1s;
}

.faded-image.is-loaded img {
opacity: 1;
}

h2 {
@@ -161,6 +186,13 @@ ul {
padding: 0 15px;
}

ul.single-column,
ul.single-column > li > ul {
column-count: 1;
margin-top: 0;
padding-right: 0;
}

ul li {
border-bottom: 1px solid #eee;
break-inside: avoid;
@@ -169,15 +201,26 @@ ul li {
padding: 5px 0;
}

ul.single-column li,
ul.single-column li > ul > li {
list-style: disc;
padding: 0;
border-bottom: 0;
}

ul.single-column li > ul > li {
list-style: circle;
}

code {
font: 14px monaco, monospace;
line-height: 1.8;
}

:not(pre)>code {
:not(pre) > code {
background-color: #f5f2f0;
border-radius: 3px;
padding: .2em .4em;
padding: 0.2em 0.4em;
}

pre {
@@ -199,32 +242,77 @@ img.screenshot {
max-width: 100%;
}

#matomoLogo {
display: block;
height: 176px;
.sponsorship a {
display: flex;
justify-content: center;
align-items: center;
}

.sponsorship a img {
display: block;
object-fit: cover;
width: 100%;
height: 100%;
}

.sponsorship {
display: flex;
justify-content: center;
margin-bottom: 60px;
display: flex;
justify-content: center;
margin-bottom: 60px;
align-items: center;
}

.sponsorship a {
padding: 0 40px;
text-decoration: none;
}

footer {
background-color: #eee;
border-top: 1px solid #ddd;
padding: 50px 0;
text-align: right;
}

footer div {
padding: 50px 30px;
color: #888;
font-size: 0.8em;
margin-right: 30px;
}

.last-modified {
#last-modified {
text-align: right;
font-style: italic;
font-size: 0.7em;
}

#copyright-notice {
max-width: 66%;
}

#external-links {
position: relative;
}

#openjsf-links {
margin: 0;
padding: 0;
box-sizing: initial;
columns: initial;
}

#openjsf-links li {
display: inline; /* displays list horizontally */
border: none;
list-style: none;
margin: initial;
padding: initial;
}

/* displays each list item with a "|" between */
#openjsf-links li + li:before {
content: ' | ';
}

#external-links .netlify-badge {
position: absolute;
right: 0;
bottom: 0;
}

.dl-inline dt,
@@ -242,6 +330,54 @@ footer div {
display: block;
}

blockquote {
border-left: 1px solid #eee;
padding: 10px;
}

figure#wallaby-logo {
vertical-align: top;
display: inline-block;
text-align: center;
}
figure#wallaby-logo figcaption {
margin-top: 10px;
display: block;
font-family: 'Open Sans', -apple-system, system-ui, 'Segoe UI', Oxygen, Ubuntu,
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
letter-spacing: 2px;
text-transform: uppercase;
color: #2c2c2c;
-webkit-font-smoothing: antialiased;
}

table {
width: 100%;
}

table td {
border-top: 1px solid #eee;
vertical-align: top;
word-break: break-all;
}

@media all and (max-width: 960px) {
#copyright-notice {
max-width: initial;
}

#openjsf-links {
width: 50%;
column-count: 2;
column-rule: 1px solid #dedede;
}

#openjsf-links li + li:before {
content: initial;
}
}

@media all and (max-width: 600px) {
#tag {
margin-top: 0;
@@ -257,9 +393,18 @@ footer div {
margin: 20px -11px;
padding: 10px;
}

/* this list is too long for smaller displays */
#openjsf-links {
width: 100%;
columns: initial;
}

#openjsf-links li {
display: block;
}
}

blockquote {
border-left: 1px solid #eee;
padding: 10px;
#mocha-fixture-wizard text[font-weight=bold]:hover {
text-decoration: underline;
}
13 changes: 13 additions & 0 deletions docs/css/supporters.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.sponsor {
-sprite-selector-for-group: sponsors;
-sprite-location: url(/images/sprite-sponsors.png?pngquant);
-sprite-image-format: png;
height: 64px;
}
.backer {
-sprite-selector-for-group: backers;
-sprite-location: url(/images/sprite-backers.png?pngquant);
-sprite-image-format: png;
width: 32px;
height: 32px;
}
2 changes: 1 addition & 1 deletion docs/example/debug-hanging-mocha.js
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ describe('how to debug Mocha when it hangs', function () {

it('should complete, but Mocha should not exit', function(done) {
const sock = net.createConnection(10101, () => {
assert.deepEqual(sock.address().family, 'IPv4');
assert.deepStrictEqual(sock.address().family, 'IPv4');
done();
});
});
12 changes: 0 additions & 12 deletions docs/images/backer-background.svg

This file was deleted.

68 changes: 68 additions & 0 deletions docs/images/openjsf-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/wallaby-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading