Skip to content

Do not bundle unit tests with babel#88

Merged
ddfridley merged 1 commit intomasterfrom
tests-run-twice
Mar 12, 2020
Merged

Do not bundle unit tests with babel#88
ddfridley merged 1 commit intomasterfrom
tests-run-twice

Conversation

@djbowers
Copy link
Collaborator

Closes #83

For this issue, I think it's sufficient to just stop the existing tests and any future unit tests from being bundled with the dist/ dir by babel, which is accomplished in this PR. Then running npm test will only pick up the tests in the app/ dir.

$ npm test

> undebate@0.0.0 test /Users/djbowers/Code/2-Areas/HackforLA/undebate
> jest --config ./jest.config.json

 PASS  app/components/lib/__tests__/cloudinary-urls.test.js
  cloudinary url utils
    ✓ should transform base webm path to mp4 & png (3ms)
    ✓ should transform formatted webm path to mp4 & png
    ✓ should raise an error on invalid webpm path (1ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        2.468s, estimated 3s
Ran all test suites.

When we start to write test files for the backend code that need to be converted to ES5 syntax before we can test them, I think we can use the babel-jest plugin. Either that or we can figure out how to run the tests against dist/ at that time.

Check out these two links for some reading on this topic of testing src/ vs dist/ with Jest

@djbowers djbowers requested a review from ddfridley March 12, 2020 15:41
@djbowers djbowers changed the title do not bundle unit tests with babel Do not bundle unit tests with babel Mar 12, 2020
@ddfridley ddfridley merged commit ceed7a9 into master Mar 12, 2020
@djbowers djbowers deleted the tests-run-twice branch March 16, 2020 18:02
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.

Tests run twice

2 participants