Skip to content

Commit

Permalink
feat: Add even more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 22, 2025
1 parent 6c0b9eb commit 9634792
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions example/src/getTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,13 +1303,38 @@ export function getTests(
.didNotThrow()
.didReturn('string')
),
createTest('NitroModules.version holds a string', () =>
it(() => {
return NitroModules.version
})
.didNotThrow()
.didReturn('string')
),
createTest('NitroModules.getAllHybridObjectNames() returns an array', () =>
it(() => {
return NitroModules.getAllHybridObjectNames()
})
.didNotThrow()
.toBeArray()
),
createTest('NitroModules.box(testObject) returns an object', () =>
it(() => {
return NitroModules.box(testObject)
})
.didNotThrow()
.didReturn('object')
),
createTest(
'NitroModules.box(testObject).unbox() returns the same object',
() =>
it(() => {
const boxed = NitroModules.box(testObject)
const original = boxed.unbox()
return original === testObject
})
.didNotThrow()
.equals(true)
),
createTest('NitroModules.hasHybridObject(testObject.name) to be true', () =>
it(() => {
return NitroModules.hasHybridObject(testObject.name)
Expand Down

0 comments on commit 9634792

Please sign in to comment.