Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
'use strict';
"use strict";

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(
require('@11ty/eleventy-plugin-inclusive-language'),
require("@11ty/eleventy-plugin-inclusive-language"),
{
words:
'simply,obviously,basically,of course,clearly,everyone knows,however,easy'
}
"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');
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')({
const markdown = require("markdown-it")({
html: true,
linkify: true,
typographer: true
typographer: true,
});

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

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

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

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

eleventyConfig.setLibrary('md', markdown);
eleventyConfig.setLibrary("md", markdown);

eleventyConfig.setUseGitIgnore(false);

return {
passthroughFileCopy: true,
dir: {
input: 'docs',
output: 'docs/_site'
}
input: "docs",
output: "docs/_site",
},
};
};
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/01-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ body:
type: textarea
description: Report a bug trying to run the code
labels:
- 'status: in triage'
- 'type: bug'
- "status: in triage"
- "type: bug"
name: 🐛 Bug
title: '🐛 Bug: <short description of the bug>'
title: "🐛 Bug: <short description of the bug>"
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/02-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body:
type: textarea
description: Report a typo or missing area of documentation
labels:
- 'area: documentation'
- 'status: in triage'
- "area: documentation"
- "status: in triage"
name: 📝 Docs
title: '📝 Docs: <short description of the request>'
title: "📝 Docs: <short description of the request>"
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/03-feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ body:
type: textarea
description: Request that a new feature be added or an existing feature improved
labels:
- 'status: in triage'
- 'type: feature'
- "status: in triage"
- "type: feature"
name: 🚀 Feature
title: '🚀 Feature: <short description of the feature>'
title: "🚀 Feature: <short description of the feature>"
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/04-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ body:
type: textarea
description: Suggest a way to make Mocha faster, more memory- and/or space-efficient, or otherwise improve performance
labels:
- 'area: performance'
- 'status: in triage'
- "area: performance"
- "status: in triage"
name: ⚡️ Performance
title: '⚡️ Performance: <short description of the change>'
title: "⚡️ Performance: <short description of the change>"
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/05-repository-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ body:
type: textarea
description: Report a bug or request an enhancement in the Mocha repository's internal tooling
labels:
- 'area: repository tooling'
- 'status: in triage'
- "area: repository tooling"
- "status: in triage"
name: 🛠 Repository Tooling
title: '🛠 Repo: <short description of the change>'
title: "🛠 Repo: <short description of the change>"
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: 'weekly'
interval: "weekly"
groups:
github-actions:
patterns:
- '*'
- "*"
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"11.7.4"}
{ ".": "11.7.4" }
2 changes: 1 addition & 1 deletion .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
test-browser:
name: 'Browser Tests'
name: "Browser Tests"
if: contains(github.event.pull_request.labels.*.name, 'run-browser-test')
uses: ./.github/workflows/npm-script.yml
secrets: inherit
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ on:
push:
branches:
- main
paths-ignore: ['*.md', 'docs/**']
paths-ignore: ["*.md", "docs/**"]
pull_request:
branches:
- main
paths-ignore: ['*.md', 'docs/**']
paths-ignore: ["*.md", "docs/**"]
workflow_dispatch:

permissions:
contents: read

jobs:
format:
uses: ./.github/workflows/npm-script.yml
with:
npm-script: format

lint:
uses: ./.github/workflows/npm-script.yml
with:
Expand All @@ -23,7 +28,7 @@ jobs:
smoke:
uses: ./.github/workflows/npm-script.yml
with:
node-versions: '20,22,24'
node-versions: "20,22,24"
npm-script: test-smoke

test-node-lts:
Expand Down Expand Up @@ -64,10 +69,10 @@ jobs:
- test-part: jsapi
coverage: false
with:
os: 'ubuntu-latest,windows-latest'
os: "ubuntu-latest,windows-latest"
# We pin exact versions here per https://github.com/mochajs/mocha/issues/5052
# Ref https://nodejs.org/en/about/previous-releases
node-versions: '20.19.4,22.18.0,24.6.0'
node-versions: "20.19.4,22.18.0,24.6.0"
npm-script: test-node:${{ matrix.test-part }}
coverage: ${{ matrix.coverage }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-site-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Nightly mochajs.org Deploy

on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

permissions:
contents: read
Expand All @@ -18,5 +18,5 @@ jobs:
- name: Webhook Action
uses: joelwmale/webhook-action@cc1a66f987e1591785273fd6f9d2f7a9d8d7c9cd
env:
data: ''
data: ""
WEBHOOK_URL: ${{ secrets.NETLIFY_NIGHTLY_DEPLOY_URL }}
14 changes: 7 additions & 7 deletions .github/workflows/npm-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ on:
workflow_call:
inputs:
npm-script:
description: 'npm script'
description: "npm script"
required: true
type: string
browsers:
description: 'A comma separated list of browser names to test with.'
description: "A comma separated list of browser names to test with."
required: false
type: string
node-versions:
description: 'A comma separated list of Node versions to test with.'
description: "A comma separated list of Node versions to test with."
required: false
type: string
os:
description: 'A comma separated list of operating systems to test on.'
description: "A comma separated list of operating systems to test on."
required: false
type: string
coverage:
description: 'Whether to set up coverage reporting or not'
description: "Whether to set up coverage reporting or not"
required: false
type: boolean

Expand Down Expand Up @@ -64,13 +64,13 @@ jobs:
- uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node_version }}
cache: 'npm'
cache: "npm"
- run: npm ci --ignore-scripts
- run: npm run ${{ inputs.npm-script }}
env:
BROWSER: ${{ matrix.browser }}
COVERAGE: ${{ inputs.coverage && '1'}}
NODE_OPTIONS: '--trace-warnings'
NODE_OPTIONS: "--trace-warnings"
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
- name: Generate coverage report
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- uses: actions/setup-node@v5
with:
# The 22.11.0 is instead of lts per https://github.com/mochajs/mocha/issues/5278
node-version: '22.11.0'
registry-url: 'https://registry.npmjs.org'
node-version: "22.11.0"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci --ignore-scripts --force --no-fund --no-audit
Expand Down
14 changes: 7 additions & 7 deletions .knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
"bin/_mocha!",
"browser-entry.js!",
"index.js!",
"lib/cli/index.js!"
"lib/cli/index.js!",
],
"project": ["{bin,lib,scripts,test}/**/*.{js,ts,mjs,cjs}"],
"ignore": [
"test/integration/fixtures/esm/type-module/test-that-imports-non-existing-module.fixture.js",
"test/integration/fixtures/options/watch/test-with-dependency.fixture.js"
"test/integration/fixtures/options/watch/test-with-dependency.fixture.js",
],
"ignoreDependencies": [
"@mocha/docdash",
"@test/esm-only-loader",
"coffeescript",
"fake",
"jsdoc-ts-utils",
"non-existent-package"
"non-existent-package",
],
"mocha": {
"entry": ["test/**/*.{js,ts,mjs,cjs}"]
"entry": ["test/**/*.{js,ts,mjs,cjs}"],
},
"webpack": {
"config": "test/browser-specific/fixtures/webpack/webpack.config.js"
"config": "test/browser-specific/fixtures/webpack/webpack.config.js",
},
"rules": {
"exports": "off"
}
"exports": "off",
},
}
20 changes: 10 additions & 10 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require: 'test/setup'
ui: 'bdd'
require: "test/setup"
ui: "bdd"
global:
- 'okGlobalA,okGlobalB'
- 'okGlobalC'
- 'callback*'
- "okGlobalA,okGlobalB"
- "okGlobalC"
- "callback*"
timeout: 1000
watch-ignore:
- '.*'
- 'docs/_site/**'
- 'node_modules'
- 'coverage'
- 'cache'
- ".*"
- "docs/_site/**"
- "node_modules"
- "coverage"
- "cache"
5 changes: 1 addition & 4 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"reporter": [
"json",
"text-summary"
],
"reporter": ["json", "text-summary"],
"exclude": [
"coverage/**",
"docs/**",
Expand Down
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.karma/
/.nyc_output
/CHANGELOG.md
/coverage
/docs/_site/
/docs/css/normalize.css
/docs/css/prism.css
/docs/js/
/pnpm-lock.yaml
/test/*/fixtures/**
Loading