Skip to content

Commit

Permalink
chore: Fix packages building on Node.js v18+ (#3666)
Browse files Browse the repository at this point in the history
* Fix packages building on Node.js v18+

* Update node version used in CI

* a better fix

* try to flush microtasks before testing popper.js

---------

Co-authored-by: Vasily Strelyaev <[email protected]>
  • Loading branch information
timbset and VasilyStrelyaev authored Nov 17, 2023
1 parent c2fb5da commit 2b97503
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Tests

on:
push:
branches-ignore:
branches-ignore:
- 'gh-pages'
pull_request:
branches-ignore:
branches-ignore:
- 'gh-pages'

jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '20'

- name: Prepare yarn
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
yarn lint
yarn test:ci
- name: Zip artifacts
- name: Zip artifacts
run: 7z a -tzip -mx3 -mmt2 artifacts.zip packages

- name: Upload build artifacts
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '20'

- name: Prepare yarn
run: |
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '20'

- name: Prepare yarn
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { mount } from 'enzyme';
import { setupConsole } from '@devexpress/dx-testing';
import { act } from 'react-dom/test-utils';
import Demo from './<%&demoName%>';

setupConsole();
Expand All @@ -17,7 +18,9 @@ window.fetch = jest.fn().mockImplementation(() => new Promise(() => {}));
// eslint-disable-next-line
window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;

it('should not fail', () => {
it('should not fail', async () => {
expect(() => { mount(<Demo />); })
.not.toThrow();

await act(async () => {});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import { mount } from 'enzyme';
import { setupConsole } from '@devexpress/dx-testing';
import { act } from 'react-dom/test-utils';
import Demo from './<%&demoName%>';

setupConsole();
Expand All @@ -16,7 +17,9 @@ jest.spyOn((Element.prototype as any), 'getBBox').mockImplementation(() => ({
window.fetch = jest.fn().mockImplementation(() => new Promise(() => { /**/ }));
(window as any).__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;

it('should not fail', () => {
it('should not fail', async () => {
expect(() => { mount(<Demo />); })
.not.toThrow();

await act(async () => {});
});
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24219,9 +24219,9 @@ webpack-virtual-modules@^0.2.2:
debug "^3.0.0"

webpack@^4.41.2, webpack@^4.44.1:
version "4.46.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.46.0.tgz#bf9b4404ea20a073605e0a011d188d77cb6ad542"
integrity sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==
version "4.47.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.47.0.tgz#8b8a02152d7076aeb03b61b47dad2eeed9810ebc"
integrity sha512-td7fYwgLSrky3fI1EuU5cneU4+pbH6GgOfuKNS1tNPcfdGinGELAqsb/BP4nnvZyKSG2i/xFGU7+n2PvZA8HJQ==
dependencies:
"@webassemblyjs/ast" "1.9.0"
"@webassemblyjs/helper-module-context" "1.9.0"
Expand Down

0 comments on commit 2b97503

Please sign in to comment.