Skip to content

Commit

Permalink
fix(3.5.1): remove watcher from worker context (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunSHamilton authored Mar 19, 2024
2 parents 024568e + 33996bd commit 559e65e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion .freeCodeCamp/tooling/tests/test-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { parentPort, workerData } from 'node:worker_threads';
// These are used in the local scope of the `eval` in `runTests`
import { assert, AssertionError, expect, config as chaiConfig } from 'chai';
import __helpers_c from '../test-utils.js';
import { watcher } from '../hot-reload.js';

import { freeCodeCampConfig, ROOT } from '../env.js';
import { join } from 'path';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
- Gated behind a feature flag
- Existing `.logs/` files will be deprecated in favour of `script` command in `4.0`

## [3.5.1] -
## [3.5.1] - 2024-03-19

### Fix

- Use `worker.postMessage` to cause side-effects in main thread
- Remove `watcher` from context in worker

## [3.5.0] - 2024-03-18

Expand Down
4 changes: 4 additions & 0 deletions docs/src/testing/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ The root of the workspace.

### `watcher`

```admonish note
This is only available in the `beforeAll` and `beforeEach` context - on the main thread.
```

The [Chokidar](https://www.npmjs.com/package/chokidar) `FSWatcher` instance.

This is useful if you want to stop watching a directory during a test:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@freecodecamp/freecodecamp-os",
"author": "freeCodeCamp",
"version": "3.5.0",
"version": "3.5.1",
"description": "Package used for freeCodeCamp projects with the freeCodeCamp Courses VSCode extension",
"scripts": {
"build:client": "NODE_ENV=production webpack --config ./.freeCodeCamp/webpack.config.cjs",
Expand Down

0 comments on commit 559e65e

Please sign in to comment.