Skip to content

Commit ac81cc5

Browse files
authored
refactor!: drop support of 'growl' notification (#4866)
1 parent 3946453 commit ac81cc5

File tree

13 files changed

+1015
-1352
lines changed

13 files changed

+1015
-1352
lines changed

.github/workflows/mocha.yml

+11-63
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- '**'
6+
- '!mochajs.org'
67
tags-ignore:
78
- '**'
89
pull_request:
@@ -12,16 +13,16 @@ on:
1213
- reopened
1314

1415
jobs:
15-
prevent-run-twice:
16-
name: Prevent to run twice
16+
prevent-double-run:
17+
name: Prevent double run
1718
runs-on: ubuntu-latest
1819
# Run 'pull-request' event only on external PRs from forked repos.
1920
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
2021
steps:
2122
- run: 'echo run Tests'
2223
smoke:
2324
name: 'Smoke [Node.js v${{ matrix.node }} / ${{ matrix.os }}]'
24-
needs: prevent-run-twice
25+
needs: prevent-double-run
2526
runs-on: '${{ matrix.os }}'
2627
strategy:
2728
matrix:
@@ -82,72 +83,19 @@ jobs:
8283
env:
8384
COVERAGE: 1
8485
steps:
85-
# - name: Cache Growl Installer (Windows)
86-
# if: "${{ matrix.os == 'windows-2019' }}"
87-
# id: cache-growl
88-
# uses: actions/cache@v2
89-
# with:
90-
# path: GrowlInstaller
91-
# key: '${{ runner.os }}-growl-installer'
92-
# restore-keys: |
93-
# ${{ runner.os }}-growl-installer
94-
# - name: Download Growl Installer (Windows)
95-
# if: "${{ matrix.os == 'windows-2019' && steps.cache-growl.outputs.cache-hit != 'true'}}"
96-
# run: >
97-
# echo "Downloading Growl installer..."
98-
99-
# mkdir GrowlInstaller | out-null
100-
101-
# $seaURL =
102-
# "https://github.com/briandunnington/growl-for-windows/releases/download/final/GrowlInstaller.exe"
103-
104-
# $seaPath = "GrowlInstaller\GrowlInstaller.exe"
105-
106-
# $webclient = New-Object Net.WebClient
107-
108-
# $webclient.DownloadFile($seaURL, $seaPath)
109-
110-
# 7z x $seaPath -oGrowlInstaller | out-null
111-
112-
# echo "Done."
113-
# - name: Retrieve Growl Installer (Windows)
114-
# if: "${{ matrix.os == 'windows-2019' }}"
115-
# uses: actions/cache@v2
116-
# with:
117-
# path: GrowlInstaller
118-
# key: '${{ runner.os }}-growl-installer'
119-
# restore-keys: |
120-
# ${{ runner.os }}-growl-installer
121-
# - name: Add Growl Installer to Path (Windows)
122-
# if: "${{ matrix.os == 'windows-2019' }}"
123-
# run: 'echo "C:\Program Files (x86)\Growl for Windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8'
124-
# - name: Install Growl
125-
# if: "${{ matrix.os == 'windows-2019' }}"
126-
# run: |
127-
# echo "Installing Growl..."
128-
# cmd /c start /wait msiexec /i GrowlInstaller\Growl_v2.0.msi /quiet
129-
# echo "Done."
130-
# - name: Start Growl Service (Windows)
131-
# if: "${{ matrix.os == 'windows-2019' }}"
132-
# run: |
133-
# echo "Starting Growl service..."
134-
# Start-Process -NoNewWindow Growl
135-
# ## Growl requires some time before it's ready to handle notifications
136-
# echo "Verifying Growl responding"
137-
# Start-Sleep -s 10
138-
# growlnotify test
139-
- name: Install libnotify-bin (Linux)
140-
if: "${{ matrix.os == 'ubuntu-latest' }}"
141-
run: sudo apt-get install libnotify-bin
14286
- uses: actions/setup-node@v2
14387
with:
14488
node-version: '${{ matrix.node }}'
14589
- uses: actions/checkout@v2
146-
- name: 'Cache node_modules (Linux)'
147-
if: "${{ matrix.os != 'windows-2019' }}"
90+
- name: Get npm cache directory in Windows
91+
id: npm-cache
92+
if: "${{ matrix.os == 'windows-2019' }}"
93+
run: |
94+
echo "::set-output name=dir::$(npm config get cache)"
95+
- name: 'Cache node_modules'
14896
uses: actions/cache@v2
14997
with:
150-
path: '~/.npm'
98+
path: ${{ matrix.os == 'ubuntu-latest' && '~/.npm' || steps.npm-cache.outputs.dir }}
15199
key: "${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}"
152100
restore-keys: |
153101
${{ matrix.os }}-node-v${{ matrix.node }}-

assets/growl/error.png

-412 Bytes
Binary file not shown.

assets/growl/ok.png

-388 Bytes
Binary file not shown.

docs/index.md

+1-78
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in
2626
- [async test timeout support](#delayed-root-suite)
2727
- [test retry support](#retry-tests)
2828
- [test-specific timeouts](#test-level)
29-
- [Growl support](#desktop-notification-support)
3029
- [reports test durations](#test-duration)
3130
- [highlights slow tests](#dot-matrix)
3231
- [file watcher support](#min)
@@ -999,12 +998,6 @@ Enable "full" stack traces. By default, Mocha attempts to distill stack traces i
999998

1000999
This flag is helpful when debugging a suspected issue within Mocha or Node.js itself.
10011000

1002-
### `--growl, -G`
1003-
1004-
Enable [Growl][] (or OS-level notifications where available).
1005-
1006-
Requires extra software to be installed; see the [growl module's docs][npm-growl] for more information.
1007-
10081001
### `--inline-diffs`
10091002

10101003
Enable "inline" diffs, an alternative output for diffing strings.
@@ -2191,71 +2184,6 @@ The HTML reporter is the default reporter when running Mocha in the browser. It
21912184

21922185
[Mochawesome][npm-mochawesome] is a great alternative to the default HTML reporter.
21932186

2194-
## Desktop Notification Support
2195-
2196-
Desktop notifications allow asynchronous communication of events without
2197-
forcing you to react to a notification immediately. Their appearance
2198-
and specific functionality vary across platforms. They typically disappear
2199-
automatically after a short delay, but their content is often stored in some
2200-
manner that allows you to access past notifications.
2201-
2202-
[Growl][] was an early notification system implementation for OS X and Windows,
2203-
hence, the name of Mocha's `--growl` option.
2204-
2205-
Once enabled, when your root suite completes test execution, a desktop
2206-
notification should appear informing you whether your tests passed or failed.
2207-
2208-
### Node-based notifications
2209-
2210-
In order to use desktop notifications with the command-line interface (CLI),
2211-
you **must** first install some platform-specific prerequisite software.
2212-
Instructions for doing so can be found [here][mocha-wiki-growl].
2213-
2214-
Enable Mocha's desktop notifications as follows:
2215-
2216-
```bash
2217-
$ mocha --growl
2218-
```
2219-
2220-
### Browser-based notifications
2221-
2222-
Web notification support is being made available for current versions of
2223-
modern browsers. Ensure your browser version supports both
2224-
[promises][caniuse-promises] and [web notifications][caniuse-notifications].
2225-
As the Notification API evolved over time, **do not expect** the minimum
2226-
possible browser version to necessarily work.
2227-
2228-
Enable Mocha's web notifications with a slight modification to your
2229-
client-side mocha HTML. Add a call to `mocha.growl()` prior to running your
2230-
tests as shown below:
2231-
2232-
```html
2233-
<!DOCTYPE html>
2234-
<html lang="en">
2235-
<head>
2236-
<meta charset="utf-8" />
2237-
<title>Mocha Tests</title>
2238-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2239-
<link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" />
2240-
</head>
2241-
<body>
2242-
<div id="mocha"></div>
2243-
2244-
<script src="https://unpkg.com/chai/chai.js"></script>
2245-
<script src="https://unpkg.com/mocha/mocha.js"></script>
2246-
2247-
<script class="mocha-init">
2248-
mocha.setup('bdd');
2249-
mocha.growl(); // <-- Enables web notifications
2250-
</script>
2251-
<script src="test.spec.js"></script>
2252-
<script class="mocha-exec">
2253-
mocha.run();
2254-
</script>
2255-
</body>
2256-
</html>
2257-
```
2258-
22592187
## Configuring Mocha (Node.js)
22602188

22612189
> _New in v6.0.0_
@@ -2422,8 +2350,7 @@ $ npm test
24222350

24232351
In addition to chatting with us on [Gitter][gitter-mocha], for additional information such as using
24242352
spies, mocking, and shared behaviours be sure to check out the [Mocha Wiki][mocha-wiki] on GitHub.
2425-
For discussions join the [Google Group][google-mocha]. For a running example of Mocha, view
2426-
[example/tests.html](example/tests.html). For the JavaScript API, view the [API documentation](api/)
2353+
For a running example of Mocha, view [example/tests.html](example/tests.html). For the JavaScript API, view the [API documentation](api/)
24272354
or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js).
24282355

24292356
[//]: # 'Cross reference section'
@@ -2452,8 +2379,6 @@ or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js).
24522379
[gist-async-hooks]: https://git.io/vdlNM
24532380
[gist-globbing-tutorial]: https://gist.github.com/reggi/475793ea1846affbcfe8
24542381
[gitter-mocha]: https://gitter.im/mochajs/mocha
2455-
[google-mocha]: https://groups.google.com/group/mochajs
2456-
[growl]: http://growl.info/
24572382
[jetbrains]: https://www.jetbrains.com/
24582383
[jetbrains-plugin]: https://www.jetbrains.com/idea/features/nodejs.html
24592384
[mdn-array-sort]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
@@ -2467,7 +2392,6 @@ or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js).
24672392
[mocha-website]: https://mochajs.org/
24682393
[mocha-wiki]: https://github.com/mochajs/mocha/wiki
24692394
[mocha-wiki-compilers]: https://github.com/mochajs/mocha/wiki/compilers-deprecation
2470-
[mocha-wiki-growl]: https://github.com/mochajs/mocha/wiki/Growl-Notifications
24712395
[mocha-wiki-more-reporters]: https://github.com/mochajs/mocha/wiki/Third-party-reporters
24722396
[node.js]: https://nodejs.org/
24732397
[node-assert]: https://nodejs.org/api/assert.html
@@ -2477,7 +2401,6 @@ or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js).
24772401
[npm-babel-register]: https://npm.im/@babel/register
24782402
[npm-chai-as-promised]: https://www.npmjs.com/package/chai-as-promised
24792403
[npm-glob]: https://www.npmjs.com/package/glob
2480-
[npm-growl]: https://npm.im/growl
24812404
[npm-mocha-lcov-reporter]: https://npm.im/mocha-lcov-reporter
24822405
[npm-mochawesome]: https://npm.im/mochawesome
24832406
[npm-should.js]: https://npm.im/should

0 commit comments

Comments
 (0)