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

fix(ember): BREAKING load polly config for ember by its own module #277

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

jasonmit
Copy link
Contributor

@jasonmit jasonmit commented Dec 10, 2019

Currently we rely on included() to be called and read all config options from app.options derived from ember-cli-build.js at the time the app is built. This strategy is no longer reliable since you can run tests against previously built assets which means included is never called nor is app.options available since the app isn't being built.

Instead, I introduced config/polly.js and rely upon my own function to determine what the env is (see: ember-cli/ember-cli#8922 as to why I had to go with that approach).

This is a breaking change for @pollyjs/ember so we'll need to release a new major for the addon.

Resolves #276

@jasonmit jasonmit requested a review from offirgolan December 10, 2019 03:45

const { assign } = Object;
function determineEnv() {
Copy link
Contributor Author

@jasonmit jasonmit Dec 10, 2019

Choose a reason for hiding this comment

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

Lifted from a previous method I wrote for ember-cli-dotenv:
https://github.com/fivetanley/ember-cli-dotenv/blob/master/index.js#L49-L68

It's been reliable for awhile and until the upstream bug is resolved there's no elegant way around it.

@@ -32,7 +32,7 @@ const { Server } = require('@pollyjs/node-server');
const server = new Server({
quiet: true,
port: 4000,
apiNamespace: '/pollyjs'
apiNamespace: '/polly'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just making the docs references consistent since they all sort of vary.

@jasonmit jasonmit merged commit 0569040 into master Dec 11, 2019
@jasonmit jasonmit deleted the u/jasonmit/fix-ember-prebuilds branch December 18, 2019 02:31
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.

pollyjs config is undefined when reusing ember build and running ember test
2 participants