Skip to content

Commit

Permalink
test: fix - api - run() from a normal saga
Browse files Browse the repository at this point in the history
  • Loading branch information
VldMrgnn committed Jan 1, 2025
1 parent 5562414 commit 7a6cc7f
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions test/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import {
AnyState,
API_ACTION_PREFIX,
ApiCtx,
call,
createApi,
createKey,
keepAlive,
mdw,
Operation,
safe,
takeEvery,
waitFor,
} from "../mod.ts";
import { useCache } from "../react.ts";
AnyState, API_ACTION_PREFIX, ApiCtx, call, createApi, createKey, keepAlive, mdw, Operation,
safe, takeEvery, waitFor
} from '../mod.ts';
import { useCache } from '../react.ts';
import {
createSchema,
createStore,
select,
slice,
updateStore,
waitForLoader,
} from "../store/mod.ts";
import { describe, expect, it } from "../test.ts";
createSchema, createStore, select, slice, updateStore, waitForLoader
} from '../store/mod.ts';
import { describe, expect, it } from '../test.ts';

interface User {
id: string;
Expand Down Expand Up @@ -264,8 +249,8 @@ it(tests, "run() from a normal saga", async () => {
const payload = { name: "/users/:id [GET]", options: { id: "1" } };

expect(extractedResults.actionType).toEqual(`${API_ACTION_PREFIX}${action1}`);
expect(extractedResults.payload!["name"]).toEqual(payload.name);
expect(extractedResults.payload!["options"]).toEqual(payload.options);
expect(extractedResults.actionPayload!["name"]).toEqual(payload.name);
expect(extractedResults.actionPayload!["options"]).toEqual(payload.options);
expect(extractedResults.name).toEqual("/users/:id [GET]");
expect(extractedResults.payload).toEqual({ id: "1" });
expect(acc).toEqual("ab");
Expand Down

0 comments on commit 7a6cc7f

Please sign in to comment.