Skip to content

Commit 6c47743

Browse files
chore(deps-dev): upgrade Mocha to 12 in the example (#418)
* ci: consolidate workflows and reduce repeated native builds * chore(deps-dev): bump mocha from 10.8.2 to 12.0.2 in /example Bumps [mocha](https://github.com/mochajs/mocha) from 10.8.2 to 12.0.2. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md) - [Commits](mochajs/mocha@v10.8.2...v12.0.2) --- updated-dependencies: - dependency-name: mocha dependency-version: 12.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * ci: boot iOS simulators before integration builds * chore: refresh native lockfiles for 10.1.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Christoph Pader <chris@margelo.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 251e509 commit 6c47743

6 files changed

Lines changed: 67 additions & 34 deletions

File tree

‎bun.lock‎

Lines changed: 57 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎example/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@types/node": "^22.7.4",
6868
"@types/react": "^19.1.1",
6969
"@types/react-test-renderer": "^19.1.0",
70-
"mocha": "^10.1.0",
70+
"mocha": "^12.0.2",
7171
"postinstall-postinstall": "^2.1.0",
7272
"react-native-harness": "1.5.0",
7373
"react-test-renderer": "19.2.3"

‎example/tests/MochaRNAdapter.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import 'mocha'
1+
// The browser bundle exposes global Mocha without importing Node-only modules.
2+
import 'mocha/mocha.js'
23
import { expect as chaiExpect } from 'chai'
34
import type { TestApi, TestExpect } from './TestApi'
45

‎example/tests/MochaSetup.test.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, it, jest } from '@jest/globals'
1+
import { describe, expect, it } from '@jest/globals'
22
import { runTests } from './MochaSetup'
33
import type { MochaTestResult } from './MochaSetup'
44
import {
@@ -7,12 +7,6 @@ import {
77
it as registerTest,
88
} from './TestApi'
99

10-
jest.mock('mocha', () => {
11-
const Runtime: typeof Mocha = jest.requireActual('mocha')
12-
Object.assign(globalThis, { Mocha: Runtime })
13-
return { __esModule: true, default: {} }
14-
})
15-
1610
describe('MochaSetup', () => {
1711
it('reports suites and test results as they finish', async () => {
1812
const results: MochaTestResult[] = []

‎example/tests/MochaSetup.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'mocha'
1+
import 'mocha/mocha.js'
22
import { createMochaTestApi } from './MochaRNAdapter'
33
import { setTestApi } from './TestApi'
44

‎example/tests/mocha-browser.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module 'mocha/mocha.js' {
2+
import type Mocha from 'mocha'
3+
const mocha: Mocha
4+
export = mocha
5+
}

0 commit comments

Comments
 (0)