Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("loading", async () => {
const actor = getApiList.with(undefined);
function Loading() {
const requesting$ = useRequesting$();
const loading = useSelector(requesting$);
return <span id="{"loading"}">{`${loading}`}</span>;
}
const store$ = Store.create({});
const node = await mount(
,
);
for (let i = 0; i < 1000; i++) {
const $loading = node.querySelector("#loading")!;
act(() => {
actor.started.invoke(store$);
});
expect($loading.innerHTML).toContain("true");it("renders the first that matches the URL", async () => {
const store$ = Store.create({
$$location: {
pathname: "/three",
search: "",
hash: "",
state: undefined,
},
});
const node = await mount(it("flow", async () => {
const persister = createPersister({
name: "test",
driver: memoryStorageDriver._driver,
});
const store$ = Store.create({ ping: 0, pong: 0 });
function App() {
useEffect(() => persister.connect(store$));
usePersist("ping");
return null;
}
await mount(
,
);
expect((store$.getState() as any)[persistedKeys] || {}).toEqual({
ping: {
key: "ping",return new Promise((resolve) => {
setTimeout(() => {
resolve({
status: StatusOK,
statusText: "OK",
data: {
"100": "https://assets-cdn.github.com/images/icons/emoji/unicode/1f4af.png?v8",
},
headers: {},
config,
});
}, 500);
});
};
const store$ = Store.create({});
store$.epicOn(
composeEpics(
createCombineDuplicatedRequestEpic(),
createRequestEpic({
baseURL: "https://api.github.com",
adapter: mock,
}),
),
);
function useEmoijs() {
const [emoijs, updateEmoijs] = useState({});
const [request] = useRequest(getEmojis);