Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 57 additions & 24 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@types/node": "^22.7.4",
"@types/react": "^19.1.1",
"@types/react-test-renderer": "^19.1.0",
"mocha": "^10.1.0",
"mocha": "^12.0.2",
"postinstall-postinstall": "^2.1.0",
"react-native-harness": "1.5.0",
"react-test-renderer": "19.2.3"
Expand Down
3 changes: 2 additions & 1 deletion example/tests/MochaRNAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'mocha'
// The browser bundle exposes global Mocha without importing Node-only modules.
import 'mocha/mocha.js'
import { expect as chaiExpect } from 'chai'
import type { TestApi, TestExpect } from './TestApi'

Expand Down
8 changes: 1 addition & 7 deletions example/tests/MochaSetup.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it, jest } from '@jest/globals'
import { describe, expect, it } from '@jest/globals'
import { runTests } from './MochaSetup'
import type { MochaTestResult } from './MochaSetup'
import {
Expand All @@ -7,12 +7,6 @@ import {
it as registerTest,
} from './TestApi'

jest.mock('mocha', () => {
const Runtime: typeof Mocha = jest.requireActual('mocha')
Object.assign(globalThis, { Mocha: Runtime })
return { __esModule: true, default: {} }
})

describe('MochaSetup', () => {
it('reports suites and test results as they finish', async () => {
const results: MochaTestResult[] = []
Expand Down
2 changes: 1 addition & 1 deletion example/tests/MochaSetup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'mocha'
import 'mocha/mocha.js'
import { createMochaTestApi } from './MochaRNAdapter'
import { setTestApi } from './TestApi'

Expand Down
5 changes: 5 additions & 0 deletions example/tests/mocha-browser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'mocha/mocha.js' {
import type Mocha from 'mocha'
const mocha: Mocha
export = mocha
}
Loading