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

184
Views
Jest running entire test file when importing single named export

I have a test file with a number of tests and a utility function exported

export function createObjects(){
const numObjects = 100;
const objects = [];
 for (let i = 1; i < numObjects + 1; i++) {
        objects.push(i);
    }
return objects
}

describe('Test describe', () => {
  it('Test', () => {
})
})

I am trying to import the createObjects function in another test. However when I import the function like below in the second test

import {createObjects} from './TestOne'

It runs the entire test suite. Any idea why this happens?

I'm using jest 24.9.0

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!