Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Add and use method to test a package's exported values #258

Merged
merged 2 commits into from
Jan 7, 2019

Conversation

pjlee11
Copy link
Contributor

@pjlee11 pjlee11 commented Jan 4, 2019

Part 1 of 2 for #156

Follows up on #224

Adds a test helper method that takes an actual import and validates it has all the exported values it is expected to have. This can then be used to simplifying testing the other utility packages exports as well as psammead-test-helpers

Has error handling logic for both new files (EG: font.js) and for exported files within those files when:

  • The actual import has additional exports when compared to the expected values. This is needed so that we do not forget to change the expectations when adding a new export.
  • The expected value has additional exports as compared to the actual exports. This is needed in the case of a breaking change when an export is to be removed. This is very useful at catching regressions in the utility packages.
  • I have assigned myself to this PR and the corresponding issues
  • Tests added for new features
  • Test engineer approval

Testing this involves ensuring no regression in the psammead-test-helpers package, which can be verified via running npm run build & npm run test. Also the psammead-test-helpers package test coverage should increase from 0% to 51.28%

Cherry pick changes to `psammead-test-helpers` from the POC PR - #224
@pjlee11 pjlee11 self-assigned this Jan 4, 2019
bcmn
bcmn previously approved these changes Jan 4, 2019
bcmn
bcmn previously approved these changes Jan 4, 2019
ChrisBAshton
ChrisBAshton previously approved these changes Jan 4, 2019
@pjlee11 pjlee11 dismissed stale reviews from ChrisBAshton and bcmn via 9a19c45 January 7, 2019 11:40
@pjlee11 pjlee11 force-pushed the test-coverage-helper-method branch from 0e9ca64 to 9a19c45 Compare January 7, 2019 11:40
@pjlee11 pjlee11 force-pushed the test-coverage-helper-method branch from 9a19c45 to 907744c Compare January 7, 2019 12:13
@pjlee11
Copy link
Contributor Author

pjlee11 commented Jan 7, 2019

snyk stalling on jobs so re-committing ...

@pjlee11
Copy link
Contributor Author

pjlee11 commented Jan 7, 2019

Confirmed that synk is hanging as the webhooks are looking at the wrong github repo

@jamesbrumpton
Copy link
Contributor

LGTM 👍

@pjlee11 pjlee11 merged commit 2a46dfe into latest Jan 7, 2019
@pjlee11 pjlee11 deleted the test-coverage-helper-method branch January 7, 2019 15:08
@pjlee11 pjlee11 mentioned this pull request Jan 7, 2019
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants