Skip to content

Commit

Permalink
Updated tests to use specific FTL module
Browse files Browse the repository at this point in the history
  • Loading branch information
cdoremus committed Oct 16, 2023
1 parent ad41df2 commit b31cf3c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
4 changes: 3 additions & 1 deletion tests/components/Button.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { cleanup, render, setup, expect } from "$fresh-testing-library";
import { cleanup, render, setup } from "$fresh-testing-library/components.ts";
import { expect } from "$fresh-testing-library/expect.ts";

import { afterEach, beforeAll, describe, it } from "std/testing/bdd.ts";
import { Button } from "../../components/Button.tsx";
import { assertEquals } from "std/assert/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion tests/components/PostList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals } from "std/assert/mod.ts";
import { cleanup, render, setup } from "$fresh-testing-library";
import { cleanup, render, setup } from "$fresh-testing-library/components.ts";
import { afterEach, beforeAll, describe, it } from "std/testing/bdd.ts";
import PostList from "../../components/PostList.tsx"

Expand Down
2 changes: 1 addition & 1 deletion tests/islands/Counter.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { signal } from "@preact/signals";
import { assertExists, assertFalse } from "std/assert/mod.ts";
import { cleanup, fireEvent, render, setup } from "$fresh-testing-library";
import { cleanup, fireEvent, render, setup } from "$fresh-testing-library/components.ts";
import { afterEach, beforeAll, describe, it } from "std/testing/bdd.ts";
import Counter from "../../islands/Counter.tsx";

Expand Down
2 changes: 1 addition & 1 deletion tests/islands/MenuLink.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals,assertNotEquals, assertExists } from "std/assert/mod.ts";
import { cleanup, render, setup } from "$fresh-testing-library";
import { cleanup, render, setup } from "$fresh-testing-library/components.ts";
import { afterEach, beforeAll, describe, it } from "std/testing/bdd.ts";
import MenuLink from "../../islands/MenuLink.tsx"

Expand Down
5 changes: 1 addition & 4 deletions tests/routes/[name].test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { createHandlerContext } from "$fresh-testing-library";

import { createHandlerContext } from "$fresh-testing-library/server.ts";
import { assert, assertEquals, fail } from "std/assert/mod.ts";
// import { describe, it } from "std/testing/bdd.ts";
import { handler } from "../../routes/[name].tsx";

import manifest from "../../fresh.gen.ts";
Expand All @@ -11,7 +9,6 @@ Deno.test("[name].tsx tests...", async (t) => {

await t.step("should pass with status=200...", async () => {
const req = new Request("https://localhost:8000/posts/How_I_made_this_blog.2022-08-07");
// const req = new Request("https://localhost:8000/posts/foobar");
// @ts-ignore ignores "type ... is not assignable to type Manifest" error
const ctx = createHandlerContext(req, { manifest });
ctx.params['name'] = "How_I_made_this_blog.2022-08-07";
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/about.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHandlerContext } from "$fresh-testing-library";
import { createHandlerContext } from "$fresh-testing-library/server.ts";
import { handler} from "../../routes/about.tsx";
import manifest from "../../fresh.gen.ts";
import { assert, assertEquals, fail } from "std/assert/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/middleware.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertEquals } from "std/assert/assert_equals.ts";
import { createMiddlewareHandlerContext } from "$fresh-testing-library";
import { createMiddlewareHandlerContext } from "$fresh-testing-library/server.ts";
import { setCacheControlHeaders } from "../../routes/_middleware.ts";
import manifest from "../../fresh.gen.ts";

Expand Down

0 comments on commit b31cf3c

Please sign in to comment.