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

Add setupPretender test helper #437

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

alexlafroscia
Copy link
Contributor

@alexlafroscia alexlafroscia commented Apr 9, 2020

  • Upgrades Pretender to the next minor version (for better type definition)
  • Adds the setupPretender helper (with type augmentation!)
  • Updates tests to actually pass type-checking based on the type definitions for Pretender

Copy link
Collaborator

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 👍

@alexlafroscia
Copy link
Contributor Author

Something is "up" with Travis; test run was not reported to the PR but it did actually run

https://travis-ci.org/github/mike-north/ember-api-actions/builds/673039505

@alexlafroscia
Copy link
Contributor Author

Travis run is green, I'm going to merge this (and rebase #428 which should use the new helper)

@alexlafroscia
Copy link
Contributor Author

Actually, I can't merge 😅 @Turbo87 could you?

@Turbo87
Copy link
Collaborator

Turbo87 commented Apr 9, 2020

I would be more comfortable if we had a working CI setup here first 😅

The TypeScript types in the version of Pretender that the current version of `ember-cli-pretender` provides don't match the actual API of pretender _or_ the way that we were using it.

Upgrade `ember-cli-pretender` bumped Pretender itself to the next major version, which ships with more accurate types.
* Add `setupPretender` helper that provides Pretender to the test context (with correct types!)
* Update tests so that there are no TypeScript errors in Pretender handlers
@alexlafroscia
Copy link
Contributor Author

Rebased to trigger CI... and now Travis is reporting again??? 🤷‍♂️

@Turbo87
Copy link
Collaborator

Turbo87 commented Apr 9, 2020

@alexlafroscia
Copy link
Contributor Author

@Turbo87 this looks ready-to-go!

@Turbo87 Turbo87 merged commit ff24733 into mike-north:master Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants