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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,5 @@ lib/
# TypeScript
tsconfig.tsbuildinfo

# React Native Harness
.harness/
164 changes: 78 additions & 86 deletions bun.lock

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions example/__tests__/image-loaders.harness.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Platform } from 'react-native'
import { describe, expect, it } from 'react-native-harness'
import { Images, loadImage } from 'react-native-nitro-image'
import { WebImages } from 'react-native-nitro-web-image'
Expand Down Expand Up @@ -143,25 +142,6 @@ describe('loadImage with { url }', () => {
})
})

describe('Images.loadFromSymbol (iOS only)', () => {
if (Platform.OS !== 'ios') {
it.skip('skipped on non-iOS platforms', () => {})
return
}

it('loads an SF Symbol image by name', () => {
const image = Images.loadFromSymbol('star.fill')
expect(image.width).toBeGreaterThan(0)
expect(image.height).toBeGreaterThan(0)
})

it('throws for an unknown SF Symbol name', () => {
expect(() =>
Images.loadFromSymbol('this.symbol.does.not.exist.anywhere'),
).toThrow()
})
})

describe('loadImage (high-level resolver)', () => {
it('resolves a { rawPixelData } source', async () => {
const buffer = makeRgbaBuffer(10, 10, [255, 255, 0, 255])
Expand Down
16 changes: 16 additions & 0 deletions example/__tests__/image-loaders.ios.harness.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'react-native-harness'
import { Images } from 'react-native-nitro-image'

describe('Images.loadFromSymbol', () => {
it('loads an SF Symbol image by name', () => {
const image = Images.loadFromSymbol('star.fill')
expect(image.width).toBeGreaterThan(0)
expect(image.height).toBeGreaterThan(0)
})

it('throws for an unknown SF Symbol name', () => {
expect(() =>
Images.loadFromSymbol('this.symbol.does.not.exist.anywhere'),
).toThrow()
})
})
12 changes: 3 additions & 9 deletions example/__tests__/image-utils.harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@ const expectFileUrlFetchable = async (path: string) => {
}

describe('ImageUtils - HEIC round-trip', () => {
it('encodes an image as HEIC, writes it to disk and loads it back', async () => {
it('encodes an image as HEIC, writes it to disk and loads it back', async (context) => {
if (!supportsHeicWriting) {
console.log(
'[skip] HEIC writing is not supported on this platform — skipping HEIC round-trip',
)
return
context.skip('HEIC writing is not supported on this platform')
}
if (!supportsHeicLoading) {
console.log(
'[skip] HEIC loading is not supported on this platform — skipping HEIC round-trip',
)
return
context.skip('HEIC loading is not supported on this platform')
}

const original = Images.createBlankImage(48, 32, false, {
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- FBLazyVector (0.85.3)
- HarnessUI (1.3.0):
- HarnessUI (1.5.0):
- hermes-engine
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -2280,7 +2280,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
FBLazyVector: 24e62c765683b8d89006a88a2c8f5cf019f0074d
HarnessUI: f439596aec93ff76765451f834c93f966d54e53e
HarnessUI: ad76f54b4b4a721258ec73dbe9c71dd445c6c220
hermes-engine: ef561c35b1325a953b54456ddbd27ee0faf01ba4
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
NitroImage: 5daf897d2f37ed419186278d6b0fcdd8aab313b0
Expand Down
8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react": "19.2.3",
"react-native": "0.85.3",
"react-native-fast-image": "^8.6.3",
"react-native-harness": "^1.3.0",
"react-native-harness": "^1.5.0",
"react-native-nitro-image": "workspace:*",
"react-native-nitro-modules": "0.37.0",
"react-native-nitro-web-image": "workspace:*",
Expand All @@ -31,9 +31,9 @@
"@react-native-community/cli": "20.1.3",
"@react-native-community/cli-platform-android": "20.1.3",
"@react-native-community/cli-platform-ios": "20.1.3",
"@react-native-harness/platform-android": "^1.3.0",
"@react-native-harness/platform-apple": "^1.3.0",
"@react-native-harness/ui": "^1.3.0",
"@react-native-harness/platform-android": "^1.5.0",
"@react-native-harness/platform-apple": "^1.5.0",
"@react-native-harness/ui": "^1.5.0",
"@react-native/babel-preset": "0.85.3",
"@react-native/metro-config": "0.85.3",
"@react-native/typescript-config": "0.85.3",
Expand Down
Loading