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

Update readme with new integration test example using latest conventions #82

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

Conversation

StephenAWalsh
Copy link

A lot has changed since Nov 2016. Our testing codebase still relies on this helper and this new syntax works great.

@alexlafroscia
Copy link

alexlafroscia commented Dec 21, 2018

Since this addon it still in use, although deprecated, this could go a step further an provide a test helper with the addon.

I created something like this for our application:

export default function setupRouteActions(hooks) {
  hooks.beforeEach(function() {
    this.owner.register(
      'helper:route-action',
      helper(([actionName]) => {
        const stubbedAction = this.routeActions[actionName];

        if (!stubbedAction) {
          throw new Error(`Missing route action stub for \`${actionName}\``);
        }
        return stubbedAction;
      })
    );

    this.routeActions = this.routeActions || {};
  });
}

ember-route-action-helper could include something like it in the addon-test-support tree so that everyone should share it.

@kexposito
Copy link

Yes please! we should update the readme with this

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.

3 participants