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 option to wrap model.createRecord in runloop #117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jbryson3
Copy link
Contributor

Summary

This PR adds the ability for users to opt into wrapping a model.createRecord in an Ember run loop. This is to avoid this error: "You have turned on testing mode, which disabled the run-loop's autorun." encountered in older versions of Ember.

Changes

  • Added a Codeshift options section to the documentation to explain how to use the new option, what it does, and why you might need to use it
  • Added the ability to pass in jscodeshift options for a test. This is done via an input test naming convention - the-test-name.option1=foo.option2=bar.input.js
  • Cleaned up the code a bit in the createModel section so its easier to read. This was accomplished by putting the nested 'j' calls in a named functions, and then calling those functions later.
p.replace(createRecordExpression(createRecordArg));

// instead of
p.replace(
  j.callExpression(
    j.memberExpression( //....
 ));

Dependencies

Depends on and branched off of #116

@Turbo87
Copy link
Collaborator

Turbo87 commented Feb 21, 2020

what do you think about having something like a setup-model-test2.options.json file instead of encoding the options in the filenames?

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

Successfully merging this pull request may close these issues.

2 participants