Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add testing with jest #1

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

test: add testing with jest #1

wants to merge 2 commits into from

Conversation

ejfox
Copy link
Owner

@ejfox ejfox commented Jul 4, 2022

So this is mostly set up except this very simple test is failing:

// TODO: This times out for some reason I do not understand
test('get NY state code from county fips', (t) => {
  const helperStateCode = helpers.getStateCodeFromCountyFips('36001')
  expect(helperStateCode).toBe('36')
})
~/code/election-helpers  master [!?⇡] is 📦 v0.0.2 ⬢ v16.13.2 // 21s 
✗  npm run test                                                             [git:master] ✖  

> election-helpers@0.0.2 test
> node --experimental-vm-modules node_modules/.bin/jest --runInBand

(node:96938) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  console.log
    36

      at Object.<anonymous> (index.test.js:8:11)

 FAIL  ./index.test.js (20.175 s)
  ✕ get NY state code from county fips (20001 ms)

  ● get NY state code from county fips

    thrown: "Exceeded timeout of 20000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

       5 | // console.log(helpers)
       6 |
    >  7 | test('get NY state code from county fips', (t) => {
         | ^
       8 |   const helperStateCode = helpers.getStateCodeFromCountyFips('36001')
       9 |   expect(helperStateCode).toBe('36')
      10 | })

      at index.test.js:7:1
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:317:13)
      at runJest (node_modules/@jest/core/build/runJest.js:407:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:339:7)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        20.21 s, estimated 21 s
Ran all test suites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant