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 "testFramework" option #28

Closed
wants to merge 1 commit into from

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Feb 24, 2016

This PR adds a testFramework option that can be used to add either ember-cli-qunit or ember-cli-mocha to the package.json file of the project that is being tested.

see emberjs/data@master...Turbo87:mocha-blueprint-tests for an example of how to use this

resolves #27

@Turbo87
Copy link
Member Author

Turbo87 commented Feb 24, 2016

this approach seems to have a problem:

  • the qunit/mocha detection in ember-data is done by checking for ember-cli-mocha in this.project.addonPackages
  • this.project.addonPackages will only list packages from the package.json if they are actually available in node_modules
  • having ember-cli-qunit and ember-cli-mocha installed in parallel is causing problems

any ideas how to resolve this?

@Turbo87
Copy link
Member Author

Turbo87 commented Feb 24, 2016

it looks like the problem can be solved by checking this.project.dependencies() instead of this.project.addonPackages, because the former one doesn't require packages to actually be installed

@Turbo87
Copy link
Member Author

Turbo87 commented Feb 24, 2016

using just a testFramework option is rather restrictive and I've been thinking whether we should generalize this approach and offer a packages options instead:

    return generateAndDestroy(['model-test', 'foo'], {
      packages: {
        'ember-cli-qunit': { remove: true },
        'ember-cli-mocha': { version: '*', dev: true }
      },
      files: [{
        file: 'tests/unit/models/foo-test.js'
      }]
    });

@trabus
Copy link
Contributor

trabus commented Feb 24, 2016

using just a testFramework option is rather restrictive and I've been thinking whether we should generalize this approach and offer a packages options instead

I like the idea, though I think the generalization kind of obscures the purpose. I'm having trouble thinking of other specific uses atm, do you have any?

@trabus
Copy link
Contributor

trabus commented Feb 24, 2016

I'm having trouble thinking of other specific uses atm, do you have any?

Actually, I take that back. It could be used to test for conflicts with other packages that may affect an installed blueprint.

@Turbo87 Turbo87 mentioned this pull request Feb 24, 2016
@Turbo87
Copy link
Member Author

Turbo87 commented Feb 24, 2016

closing this in favor of #31

@Turbo87 Turbo87 closed this Feb 24, 2016
@Turbo87 Turbo87 deleted the test-framework branch March 7, 2016 06:18
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.

Add "testFramework" option
2 participants