Skip to content

Commit 224f7ac

Browse files
Merge branch 'master' into fix-yargs-link-in-docs
2 parents 60ad173 + b41e985 commit 224f7ac

36 files changed

+7661
-10364
lines changed

.github/workflows/browser-test.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@ jobs:
1212
runs-on: ubuntu-latest
1313
if: contains(github.event.pull_request.labels.*.name, 'run-browser-test')
1414
steps:
15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 16
18-
- uses: actions/checkout@v3
17+
node-version: lts/*
18+
- uses: actions/checkout@v4
1919
with:
2020
ref: ${{ github.event.pull_request.head.sha }}
21+
persist-credentials: false
2122
- name: 'Cache node_modules'
2223
uses: actions/cache@v3
2324
with:
2425
path: '~/.npm'
25-
key: "ubuntu-latest-node-full-v16-${{ hashFiles('**/package-lock.json') }}"
26-
restore-keys: |
27-
ubuntu-latest-node-full-v16-
26+
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
2827
- name: Install Dependencies
2928
run: npm ci
3029
- name: Run Browser Tests
@@ -33,7 +32,7 @@ jobs:
3332
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
3433
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
3534
- name: remove 'run-browser-test' label
36-
uses: buildsville/add-remove-label@v1
35+
uses: buildsville/add-remove-label@v2.0.0
3736
if: ${{ always() }}
3837
with:
3938
token: ${{secrets.GITHUB_TOKEN}}

.github/workflows/delete-runs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
inputs:
55
days:
66
description: 'Number of days'
7+
type: number
78
required: true
89
default: 180
910

.github/workflows/mocha.yml

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ jobs:
2222
- name: Check event pull_request
2323
if: github.event_name == 'pull_request'
2424
run: 'echo pull_request: run workflow'
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
if: github.event_name == 'push'
27+
with:
28+
persist-credentials: false
2729
- name: Check event push
2830
id: findPr
2931
if: github.event_name == 'push'
@@ -45,9 +47,12 @@ jobs:
4547
- 14
4648
- 16
4749
- 18
50+
- 20
4851
steps:
49-
- uses: actions/checkout@v3
50-
- uses: actions/setup-node@v3
52+
- uses: actions/checkout@v4
53+
with:
54+
persist-credentials: false
55+
- uses: actions/setup-node@v4
5156
with:
5257
node-version: '${{ matrix.node }}'
5358
- run: npm install --production
@@ -58,17 +63,17 @@ jobs:
5863
runs-on: ubuntu-latest
5964
needs: smoke
6065
steps:
61-
- uses: actions/setup-node@v3
66+
- uses: actions/setup-node@v4
6267
with:
63-
node-version: 16
64-
- uses: actions/checkout@v3
68+
node-version: lts/*
69+
- uses: actions/checkout@v4
70+
with:
71+
persist-credentials: false
6572
- name: 'Cache node_modules'
6673
uses: actions/cache@v3
6774
with:
6875
path: '~/.npm'
69-
key: "ubuntu-latest-node-v16-${{ hashFiles('**/package-lock.json') }}"
70-
restore-keys: |
71-
ubuntu-latest-node-v16-
76+
key: "ubuntu-latest-node-lts-${{ hashFiles('**/package-lock.json') }}"
7277
- name: Install Dependencies
7378
run: npm ci --ignore-scripts
7479
- name: 'Check lint'
@@ -89,28 +94,29 @@ jobs:
8994
- 14
9095
- 16
9196
- 18
97+
- 20
9298
include:
9399
- os: ubuntu-latest
94100
node: 16
95101
env:
96102
COVERAGE: 1
97103
steps:
98-
- uses: actions/setup-node@v3
104+
- uses: actions/setup-node@v4
99105
with:
100106
node-version: '${{ matrix.node }}'
101-
- uses: actions/checkout@v3
107+
- uses: actions/checkout@v4
108+
with:
109+
persist-credentials: false
102110
- name: Get npm cache directory in Windows
103111
id: npm-cache
104112
if: ${{ matrix.os == 'windows-2019' }}
105113
run: |
106-
echo "::set-output name=dir::$(npm config get cache)"
114+
echo "dir=$(npm config get cache)" >> $env:GITHUB_OUTPUT
107115
- name: 'Cache node_modules'
108116
uses: actions/cache@v3
109117
with:
110118
path: ${{ matrix.os == 'ubuntu-latest' && '~/.npm' || steps.npm-cache.outputs.dir }}
111119
key: "${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}"
112-
restore-keys: |
113-
${{ matrix.os }}-node-v${{ matrix.node }}-
114120
- name: Install Dependencies
115121
run: npm ci --ignore-scripts
116122
- name: Install Annotation Support
@@ -131,31 +137,69 @@ jobs:
131137
with:
132138
github-token: '${{ secrets.GITHUB_TOKEN }}'
133139

134-
test-browser:
135-
name: 'Browser Tests'
140+
test-browser-local:
141+
name: Browser Test [ChromeHeadless]
136142
needs: smoke
137143
runs-on: ubuntu-latest
138144
timeout-minutes: 20
139145
# Don't run forked 'pull_request' without saucelabs token
140146
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
141147
steps:
142-
- uses: actions/setup-node@v3
148+
- uses: actions/setup-node@v4
149+
with:
150+
node-version: lts/*
151+
- uses: actions/checkout@v4
152+
with:
153+
persist-credentials: false
154+
- name: 'Cache node_modules'
155+
uses: actions/cache@v3
156+
with:
157+
path: '~/.npm'
158+
# this key is different than above, since we are running scripts
159+
# (builds, postinstall lifecycle hooks, etc.)
160+
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
161+
- name: Install Dependencies
162+
run: npm ci
163+
- name: Run Browser Tests
164+
run: npm start test.browser
165+
env:
166+
BROWSER: ChromeHeadless
167+
168+
test-browser-saucelabs:
169+
name: Browser Tests on SauceLabs [${{ matrix.browser }}]
170+
needs:
171+
- smoke
172+
- test-browser-local
173+
runs-on: ubuntu-latest
174+
timeout-minutes: 20
175+
strategy:
176+
matrix:
177+
browser:
178+
- firefox@latest
179+
- chrome@latest
180+
- MicrosoftEdge@latest
181+
- safari@latest
182+
# Don't run forked 'pull_request' without saucelabs token
183+
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
184+
steps:
185+
- uses: actions/setup-node@v4
186+
with:
187+
node-version: lts/*
188+
- uses: actions/checkout@v4
143189
with:
144-
node-version: 16
145-
- uses: actions/checkout@v3
190+
persist-credentials: false
146191
- name: 'Cache node_modules'
147192
uses: actions/cache@v3
148193
with:
149194
path: '~/.npm'
150195
# this key is different than above, since we are running scripts
151196
# (builds, postinstall lifecycle hooks, etc.)
152-
key: "ubuntu-latest-node-full-v16-${{ hashFiles('**/package-lock.json') }}"
153-
restore-keys: |
154-
ubuntu-latest-node-full-v16-
197+
key: "ubuntu-latest-node-full-lts-${{ hashFiles('**/package-lock.json') }}"
155198
- name: Install Dependencies
156199
run: npm ci
157200
- name: Run Browser Tests
158201
run: npm start test.browser
159202
env:
160203
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
161204
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
205+
BROWSER: ${{ matrix.browser }}

.github/workflows/nightly-site-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Webhook Action
13-
uses: joelwmale/webhook-action@1.0.0
13+
uses: joelwmale/webhook-action@2.3.2
1414
env:
1515
data: ''
1616
WEBHOOK_URL: ${{ secrets.NETLIFY_NIGHTLY_DEPLOY_URL }}

.github/workflows/stale.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

AUTHORS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,5 +535,12 @@ Mattias Norlander <[email protected]>
535535
CommanderRoot <[email protected]>
536536
Elihu Cruz <[email protected]>
537537
538+
Darius Dzien <[email protected]>
539+
Yeting Li <[email protected]>
540+
541+
Josh Goldberg <[email protected]>
542+
Kleis Auke Wolthuizen <[email protected]>
543+
Paulo Gonçalves <[email protected]>
544+
Anton Usmansky <[email protected]>
538545

539546
# Generated by scripts/update-authors.js

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# 10.2.0 / 2022-12-11
2+
3+
## :tada: Enhancements
4+
5+
- [#4945](https://github.com/mochajs/mocha/issues/4945): API: add possibility to decorate ESM name before import ([**@j0tunn**](https://github.com/j0tunn))
6+
7+
## :bug: Fixes
8+
9+
- [#4946](https://github.com/mochajs/mocha/issues/4946): Browser: color of failed test icon ([**@kleisauke**](https://github.com/kleisauke))
10+
11+
## :book: Documentation
12+
13+
- [#4944](https://github.com/mochajs/mocha/issues/4944): Remove duplicated header ([**@PauloGoncalvesBH**](https://github.com/PauloGoncalvesBH))
14+
15+
# 10.1.0 / 2022-10-16
16+
17+
## :tada: Enhancements
18+
19+
- [#4896](https://github.com/mochajs/mocha/issues/4896): Browser: add support for `prefers-color-scheme: dark` ([**@greggman**](https://github.com/greggman))
20+
21+
## :nut\_and\_bolt: Other
22+
23+
- [#4912](https://github.com/mochajs/mocha/issues/4912): Browser: increase contrast for replay buttons ([**@JoshuaKGoldberg**](https://github.com/JoshuaKGoldberg))
24+
- [#4905](https://github.com/mochajs/mocha/issues/4905): Use standard `Promise.allSettled` instead of polyfill ([**@outsideris**](https://github.com/outsideris))
25+
- [#4899](https://github.com/mochajs/mocha/issues/4899): Upgrade official GitHub actions to latest ([**@ddzz**](https://github.com/ddzz))
26+
- [#4770](https://github.com/mochajs/mocha/issues/4770): Fix regex in function `clean`([**@yetingli**](https://github.com/yetingli))
27+
128
# 10.0.0 / 2022-05-01
229

330
## :boom: Breaking Changes

docs/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,6 @@ It can however make the output harder to interpret when comparing large strings.
990990

991991
A value of 0 indicates no limit, default is 8192 characters.
992992

993-
## Command-Line Usage
994-
995993
### `--full-trace`
996994

997995
Enable "full" stack traces. By default, Mocha attempts to distill stack traces into less noisy (though still useful) output.

karma.conf.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const rollupPlugin = require('./scripts/karma-rollup-plugin');
2828
const BASE_BUNDLE_DIR_PATH = path.join(__dirname, '.karma');
2929
const env = process.env;
3030
const hostname = os.hostname();
31+
const BROWSER = env.BROWSER;
3132

3233
const SAUCE_BROWSER_PLATFORM_MAP = {
3334
'chrome@latest': 'Windows 10',
@@ -120,6 +121,13 @@ module.exports = config => {
120121
files: [...cfg.files, {pattern: './mocha.js.map', included: false}]
121122
};
122123

124+
if (BROWSER) {
125+
cfg = {
126+
...cfg,
127+
browsers: [BROWSER]
128+
};
129+
}
130+
123131
config.set(cfg);
124132
};
125133

@@ -171,7 +179,7 @@ const addSauceTests = (cfg, sauceLabs) => {
171179
const customLaunchers = sauceBrowsers.reduce((acc, sauceBrowser) => {
172180
const platformName = SAUCE_BROWSER_PLATFORM_MAP[sauceBrowser];
173181
const [browserName, browserVersion] = sauceBrowser.split('@');
174-
return {
182+
const result = {
175183
...acc,
176184
[sauceBrowser]: {
177185
base: 'SauceLabs',
@@ -181,9 +189,13 @@ const addSauceTests = (cfg, sauceLabs) => {
181189
'sauce:options': sauceLabs
182190
}
183191
};
192+
if (browserName === 'firefox') {
193+
result[sauceBrowser]['sauce:options']['moz:debuggerAddress'] = true;
194+
}
195+
return result;
184196
}, {});
185197

186-
return {
198+
const result = {
187199
...cfg,
188200
reporters: [...cfg.reporters, 'saucelabs'],
189201
browsers: [...cfg.browsers, ...sauceBrowsers],
@@ -197,6 +209,7 @@ const addSauceTests = (cfg, sauceLabs) => {
197209
captureTimeout: 120000,
198210
browserNoActivityTimeout: 20000
199211
};
212+
return result;
200213
}
201214
return {...cfg};
202215
};

lib/cli/collect-files.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ module.exports = ({
3535
try {
3636
const moreSpecFiles = castArray(lookupFiles(arg, extension, recursive))
3737
.filter(filename =>
38-
ignore.every(pattern => !minimatch(filename, pattern))
38+
ignore.every(
39+
pattern =>
40+
!minimatch(filename, pattern, {windowsPathsNoEscape: true})
41+
)
3942
)
4043
.map(filename => path.resolve(filename));
4144
return [...specFiles, ...moreSpecFiles];

0 commit comments

Comments
 (0)