Skip to content

Commit 2339ffc

Browse files
committed
fix: skip deprecation tests on legacy backend
Legacy backend doesn't have DeprecationWarning.warn() calls in its deprecated methods, so deprecation-specific tests are skipped when running with the legacy runtime.
1 parent 376528f commit 2339ffc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

example/__tests__/rivelog.harness.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { describe, it, expect, waitFor, cleanup } from 'react-native-harness';
22
import { RiveFileFactory, RiveLog } from '@rive-app/react-native';
33

44
const BOUNCING_BALL = require('../assets/rive/bouncing_ball.riv');
5+
const isExperimental = RiveFileFactory.getBackend() === 'experimental';
56

67
type LogEntry = { level: string; tag: string; message: string };
78

89
describe('RiveLog', () => {
9-
it('captures deprecation warning from sync method', async () => {
10+
// Deprecation warnings only fire in the experimental backend
11+
(isExperimental ? it : it.skip)('captures deprecation warning from sync method', async () => {
1012
const logs: LogEntry[] = [];
1113
RiveLog.setHandler((level, tag, message) => {
1214
logs.push({ level, tag, message });
@@ -31,7 +33,7 @@ describe('RiveLog', () => {
3133
cleanup();
3234
});
3335

34-
it('emits each deprecation only once', async () => {
36+
(isExperimental ? it : it.skip)('emits each deprecation only once', async () => {
3537
const logs: LogEntry[] = [];
3638
RiveLog.setHandler((level, tag, message) => {
3739
logs.push({ level, tag, message });

0 commit comments

Comments
 (0)