Full Stack Development

Running and Testing

by Tomas Trescak
t.trescak@westernsydney.edu.au

Project

Running

    pnpm dev
  
    > initial-t3@0.1.0 dev /workspaces/introduction-to-react-fullstackblazon
> next dev

  ▲ Next.js 14.2.2
  - Local:        http://localhost:3000

 ✓ Starting...
 ✓ Ready in 2.1s
 ○ Compiling / ...
 ✓ Compiled / in 5.4s (477 modules)
 GET / 200 in 5623ms
  

Project

Running

Project

Running

Project

Testing

  • Unit Testing
  • Automated Tests
  • pnpm test

Testing


Testing

    describe("Page Test", function () {
  it("Show the welcome header", async function () {
    render(
      <Suspense>
        <Page />
      </Suspense>
    );
    expect(await screen.findByText("Get Things Done")).toBeInTheDocument();
  });
});
  

Testing

    describe("Page Test", function () {
  it("Show the welcome header", async function () {
    render(
      <Suspense>
        <Page />
      </Suspense>
    );
    expect(await screen.findByText("Get Things Done")).toBeInTheDocument();
  });

  it("Show the list of tasks", async function () {
    render(
      <Suspense>
        <Page />
      </Suspense>
    );
    expect(await screen.findByText("Task 1")).toBeInTheDocument();
    expect(screen.getByText("Task 2")).toBeInTheDocument();
    expect(screen.getByText("Task 3")).toBeInTheDocument();
  });
});