diff --git a/.circleci/config.yml b/.circleci/config.yml index f6614bab3220..b28f93ee3a3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,5 +54,5 @@ workflows: name: test-node-partial-<< matrix.node-version >> matrix: parameters: - node-version: ['12', '14', '16', '17'] + node-version: ['12', '14', '16', '17', '18'] - test-jest-jasmine diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e69d8c36226f..ec67774a5153 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -101,7 +101,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [12.x, 14.x, 16.x, 17.x] + node-version: [12.x, 14.x, 16.x, 17.x, 18.x] os: [ubuntu-latest, macOS-latest, windows-latest] shard: ['1/4', '2/4', '3/4', '4/4'] runs-on: ${{ matrix.os }} diff --git a/.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch b/.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch new file mode 100644 index 000000000000..28b1e00527da --- /dev/null +++ b/.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch @@ -0,0 +1,18 @@ +diff --git a/jest/setup.js b/jest/setup.js +index 5bc65447594091c2da6dadb4be6bc1c6da43c7a0..356e7ff3eb55947e084db5d1df9b2d9f0544a15b 100644 +--- a/jest/setup.js ++++ b/jest/setup.js +@@ -17,13 +17,8 @@ jest.requireActual('@react-native/polyfills/error-guard'); + + global.__DEV__ = true; + +-global.performance = { +- now: jest.fn(Date.now), +-}; +- + global.Promise = jest.requireActual('promise'); + global.regeneratorRuntime = jest.requireActual('regenerator-runtime/runtime'); +-global.window = global; + + global.requestAnimationFrame = function (callback) { + return setTimeout(callback, 0); diff --git a/package.json b/package.json index 6cc88e839cbd..ff0747191f4b 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,8 @@ "resolutions": { "babel-jest": "workspace:*", "jest": "workspace:*", - "jest-environment-node": "workspace:*" + "jest-environment-node": "workspace:*", + "react-native@0.68.1": "patch:react-native@npm:0.68.1#.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch" }, "packageManager": "yarn@3.2.0" } diff --git a/yarn.lock b/yarn.lock index 428a3a0a9ec5..698966324eb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18602,6 +18602,50 @@ __metadata: languageName: node linkType: hard +"react-native@patch:react-native@npm:0.68.1#.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch::locator=%40jest%2Fmonorepo%40workspace%3A.": + version: 0.68.1 + resolution: "react-native@patch:react-native@npm%3A0.68.1#.yarn/patches/react-native-npm-0.68.1-8830b7be0d.patch::version=0.68.1&hash=b59fc5&locator=%40jest%2Fmonorepo%40workspace%3A." + dependencies: + "@jest/create-cache-key-function": ^27.0.1 + "@react-native-community/cli": ^7.0.3 + "@react-native-community/cli-platform-android": ^7.0.1 + "@react-native-community/cli-platform-ios": ^7.0.1 + "@react-native/assets": 1.0.0 + "@react-native/normalize-color": 2.0.0 + "@react-native/polyfills": 2.0.0 + abort-controller: ^3.0.0 + anser: ^1.4.9 + base64-js: ^1.1.2 + deprecated-react-native-prop-types: ^2.3.0 + event-target-shim: ^5.0.1 + hermes-engine: ~0.11.0 + invariant: ^2.2.4 + jsc-android: ^250230.2.1 + metro-react-native-babel-transformer: 0.67.0 + metro-runtime: 0.67.0 + metro-source-map: 0.67.0 + nullthrows: ^1.1.1 + pretty-format: ^26.5.2 + promise: ^8.0.3 + react-devtools-core: ^4.23.0 + react-native-codegen: ^0.0.13 + react-native-gradle-plugin: ^0.0.6 + react-refresh: ^0.4.0 + react-shallow-renderer: 16.14.1 + regenerator-runtime: ^0.13.2 + scheduler: ^0.20.2 + stacktrace-parser: ^0.1.3 + use-subscription: ">=1.0.0 <1.6.0" + whatwg-fetch: ^3.0.0 + ws: ^6.1.4 + peerDependencies: + react: 17.0.2 + bin: + react-native: cli.js + checksum: 9cde185dcf581af0ec53a79f73d74b5d5d7437b4d78f5b5cf562717b7dae2d967aa9ce274b05f5803a52f3c549a9bcc586fc53a40ca02d154257ce31916f8d61 + languageName: node + linkType: hard + "react-refresh@npm:^0.4.0": version: 0.4.3 resolution: "react-refresh@npm:0.4.3"