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

Handle "options generator" functions for moduleFor* #14

Open
rwjblue opened this issue Oct 21, 2017 · 2 comments
Open

Handle "options generator" functions for moduleFor* #14

rwjblue opened this issue Oct 21, 2017 · 2 comments
Labels

Comments

@rwjblue
Copy link
Member

rwjblue commented Oct 21, 2017

Input:

moduleFor('service:foo', callSomeMethod());

test('stuff here', function(assert) {
  // ...snip...
});

Suggested output:

import { module } from 'qunit';
import { setupTest } from 'ember-qunit';

let options = callSomeMethod();
module('service:foo', function(hooks) {
  setupTest(hooks);

  options.before && hooks.before(options.before);
  options.beforeEach && hooks.beforeEach(options.beforeEach);
  options.afterEach && hooks.afterEach(options.afterEach);
  options.after && hooks.after(options.after);
});

test('stuff here', function(assert) {
  // ...snip...
});
@rwjblue rwjblue added the bug label Oct 21, 2017
@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 21, 2017

I'd prefer real if conditions

@rwjblue
Copy link
Member Author

rwjblue commented Oct 21, 2017

Ya, definitely fine with me also.

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

No branches or pull requests

2 participants