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

ember test with Testem. #388

Merged
merged 1 commit into from
Apr 23, 2014
Merged

Conversation

abuiles
Copy link
Member

@abuiles abuiles commented Apr 18, 2014

Not ready to be merged yet, but would love feedback as we advance.

Things to do

  • Support testem options
  • get tests running
  • Add documentation

In the future it would be great to make easy for people to extend/patch task so in the test case everyone could write their own on top of their favorite runner and just installed them from bower.

@abuiles
Copy link
Member Author

abuiles commented Apr 20, 2014

This is working now, but I still need to get test passing, plus figure it out a better way to proxy testem options. welcome any comments.

@stefanpenner
Copy link
Contributor

<3


return build.run(ui, { environment: 'test', outputPath: options.cwd }).
then(function() {
test.run(ui, options);
Copy link
Contributor

Choose a reason for hiding this comment

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

return

@abuiles
Copy link
Member Author

abuiles commented Apr 21, 2014

@stefanpenner did some changes and took some of the suggestions made on previous version, I feel comfortable with this as a 0.1 for ember test and then we can keep iterating on top of that.

There is still one issue, tests are actually not being run, can you give me some review on that, I think I'm doing something wrong with le promises.

var testRun = env.tasks.test.run;

command.run(ui, env, { }).then(function(){
assert.equal(buildRun.called, 2, 'expected build task to be called once');
Copy link
Member Author

Choose a reason for hiding this comment

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

this is intentional just to verify that my assertions are not being hit :(

Copy link
Contributor

Choose a reason for hiding this comment

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

wanna leave an inline comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

@stefanpenner sure, but this "should" be running? Or I did something wrong with the promises?

Copy link
Member Author

Choose a reason for hiding this comment

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

@stefanpenner added comment, having a second look trying to figure it out what's up with this. Also will start to work on docs for the website.

@stefanpenner
Copy link
Contributor

@abuiles I will review and investigate the issue you are having first thing in the morning.

@abuiles
Copy link
Member Author

abuiles commented Apr 21, 2014

@abuiles I will review and investigate the issue you are having first thing in the morning.

thanks 👍

@abuiles abuiles mentioned this pull request Apr 22, 2014
@abuiles abuiles changed the title WIP: ember test with testem. ember test with Testem. Apr 22, 2014

command.run(ui, env, { }).then(function(){
// Intentional just to verify that assertions is not hit.
assert.equal(buildRun.called, 2, 'expected build task to be called once');
Copy link
Member Author

Choose a reason for hiding this comment

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

@MajorBreakfast could you chime in here? I was expecting this tests to assert but they are not, must be something with the promises.

Copy link
Contributor

Choose a reason for hiding this comment

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

you forgot the return statement in line 41.
BTW move the .then() to the next line. -> ARCHITECTURE.md style guide.

Copy link
Member Author

Choose a reason for hiding this comment

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

@MajorBreakfast > you forgot the return statement in line 41.

Facepalm... thanks!

@abuiles
Copy link
Member Author

abuiles commented Apr 22, 2014

All fixed here, tests are now running (thanks @MajorBreakfast!) I'll call this a 0.1 🎆

run: function() { }
},
test: {
run: function() { }
Copy link
Contributor

Choose a reason for hiding this comment

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

inherit from real Task class

Copy link
Contributor

Choose a reason for hiding this comment

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

function() { return Promise.resolve() }, then you don't need to stub it. (Also omit true, it's not needed)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed the return value, not inhering for the real Task, this is a stub it's fine to use just an object.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MajorBreakfast
Copy link
Contributor

@abuiles If you want you can take a "comment" revenge next time I post a PR :)

@abuiles
Copy link
Member Author

abuiles commented Apr 22, 2014

@MajorBreakfast it's fine ;) I'll go over this again later tonight.

@abuiles
Copy link
Member Author

abuiles commented Apr 22, 2014

@MajorBreakfast just went over the second revision and make changes accordingly, thanks! cc @stefanpenner

@stefanpenner stefanpenner added this to the v0.0.23 milestone Apr 23, 2014
@@ -0,0 +1,61 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

love the file name

Copy link
Contributor

Choose a reason for hiding this comment

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

:D

@stefanpenner
Copy link
Contributor

i think this a good first pass, thanks @abuiles

stefanpenner added a commit that referenced this pull request Apr 23, 2014
@stefanpenner stefanpenner merged commit f173e3a into ember-cli:master Apr 23, 2014
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.

4 participants