Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
How to write unit test with Jest, Fastdom and Preact

I am working on a project that uses fastdom, typescript and preact, and @testing-library/preact. But when I try to write a test, it complains that fastdom is undefined.

My question is how does the fastdom and the preact testing library work? I suppose it runs only that component I render, but it doesn't seem to the case.

here is my code

// SearchResult.test.tsx
import SearchResult from '##/components/SearchResult';

describe('Search Result', () => {
  it('should start with a blank screen', () => {
    render(<SearchResult isLoading={false} />);
    expect(screen.children.length).toEqual(0);
  });
});

Error Message: enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!