Skip to content

Commit

Permalink
test: set react flags in spec files only
Browse files Browse the repository at this point in the history
  • Loading branch information
littensy committed Jun 18, 2024
1 parent 0c36178 commit c5e214e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/init.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_G.__ROACT_17_MOCK_SCHEDULER__ = true;

export = () => {
afterAll(() => {
_G.__ROACT_17_MOCK_SCHEDULER__ = undefined;
});
};
4 changes: 2 additions & 2 deletions src/react-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface _G {
__DEV__: boolean;
__ROACT_17_MOCK_SCHEDULER__: boolean;
__DEV__?: boolean;
__ROACT_17_MOCK_SCHEDULER__?: boolean;
}
2 changes: 0 additions & 2 deletions src/utils/testez.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
_G.__ROACT_17_MOCK_SCHEDULER__ = true;

import React, { useRef } from "@rbxts/react";
import { act, createLegacyRoot } from "@rbxts/react-roblox";

Expand Down

0 comments on commit c5e214e

Please sign in to comment.