Skip to content

Commit

Permalink
Merge branch 'master' into add_option_inline_serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Aug 13, 2021
2 parents a38769d + 43a8ada commit 432f78c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2.0.3
- uses: dessant/lock-threads@v2.1.1
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '30'
Expand Down
50 changes: 8 additions & 42 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,10 @@ jobs:
steps:
- uses: actions/[email protected]

- uses: actions/setup-node@v2.1.5
- uses: actions/setup-node@v2.4.0
with:
node-version: 14.x

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
cache: yarn

- name: Validate cache
env:
Expand All @@ -54,18 +44,10 @@ jobs:

steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v2.1.5
- uses: actions/setup-node@v2.4.0
with:
node-version: 12.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
cache: yarn
- name: install
run: yarn --immutable
- name: build
Expand Down Expand Up @@ -101,18 +83,10 @@ jobs:
if: runner.os == 'Windows'
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.4.0
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
cache: yarn
- name: install
run: yarn --immutable
- name: build
Expand Down Expand Up @@ -141,18 +115,10 @@ jobs:
if: runner.os == 'Windows'
- uses: actions/[email protected]
- name: Use Node.js 14.x
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.4.0
with:
node-version: 14.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/[email protected]
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn2-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn2-
cache: yarn
- name: install
run: yarn --immutable
- name: build
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Fixes

- `[jest-environment-node]` Add `Event` and `EventTarget` to node global environment. ([#11705](https://github.com/facebook/jest/issues/11705))

### Chore & Maintenance

### Performance
Expand Down
8 changes: 8 additions & 0 deletions packages/jest-environment-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class NodeEnvironment implements JestEnvironment {
if (typeof AbortController !== 'undefined') {
global.AbortController = AbortController;
}
// Event is global in Node >= 15.4
if (typeof Event !== 'undefined') {
global.Event = Event;
}
// EventTarget is global in Node >= 15.4
if (typeof EventTarget !== 'undefined') {
global.EventTarget = EventTarget;
}
installCommonGlobals(global, config.globals);

this.moduleMocker = new ModuleMocker(global);
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2020-01-21-jest-25.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The APIs Jest will use are still flagged and experimental, so don't expect suppo
- Jest’s feature `--detect-leaks` has been broken for Node 12 and newer - this has been fixed in Jest 25.
- As announced in the blog post for Jest 24, Jest’s code base has been rewritten in TypeScript - this work was completed in Jest 24.3. So if you use any of Jest’s individual parts, you should get great IDE integration. Looking forward, we really want to make Jest mocks play nicer with type systems, and we’d love the community’s help with this. Please chime in [here](https://github.com/facebook/jest/issues/7832) with ideas and send PRs! We’ll also be investigating moving the typings for using Jest as a test runner from DefinitelyTyped into Jest itself.
- The `jest-diff` package now exports functions like `diffLinesUnified` and `diffStringsUnified` which have configuration options, so other applications can format differences in a custom way. For more information and code examples, see its new `README.md` file in the Jest repository or on package repositories.
- Thanks to community member [Wei An Yen](https://github.com/WeiAnAn), Jest will no longer highlight passing asymmetric matchers in expectation errors. This has been a long-standing pain point with asmmetric matchers and we're very happy it's finally solved.
- Thanks to community member [Wei An Yen](https://github.com/WeiAnAn), Jest will no longer highlight passing asymmetric matchers in expectation errors. This has been a long-standing pain point with asymmetric matchers and we're very happy it's finally solved.
- For the second year running, Jest won the Highest Satisfaction award from [State of JS](https://2019.stateofjs.com/awards/). We are incredibly grateful for the support from the community, and hope we can build on this momentum to make 2020 even better!

## Plans for the future
Expand Down

0 comments on commit 432f78c

Please sign in to comment.