juliemr / minijasminenode

A very bare-bones version of jasmine-node
MIT License
32 stars 21 forks source link

use jasmine core instead of copied jasmine.js #14

Closed cyrret closed 10 years ago

cyrret commented 10 years ago

We noticed that you were copying in jasmine-2.0.0 manually. The blessed way to add this dependency is to use jasmine-core.

One other suggestion is perhaps also to roll minijasminenode into Protractor so that Protractor uses jasmine-core directly. Although perhaps you have already thought about this and have decided this is already the desired abstraction.

juliemr commented 10 years ago

@cyrret the Jamine2 version is still a big experimental - honestly, I'd prefer to just wait until that main function is completed in the next version.

cyrret commented 10 years ago

@juliemr, can you explain in more detail what you're waiting for to be completed? I'd like to understand so that your use cases in Protractor, etc. are better supported.

Ideally, we can avoid the need potentially two different versions of Jasmine in their application, one for end-to-end testing and one for unit testing....as well as help break down any barriers that are preventing folks from upgrading to 2.0.


Terry Chen tchen120@gmail.com

On Fri, Apr 4, 2014 at 4:15 PM, Julie Ralph notifications@github.comwrote:

@cyrret https://github.com/cyrret the Jamine2 version is still a big experimental - honestly, I'd prefer to just wait until that main function is completed in the next version.

Reply to this email directly or view it on GitHubhttps://github.com/juliemr/minijasminenode/pull/14#issuecomment-39620528 .

juliemr commented 10 years ago

@cyrret I think I answered this in #9.

I was feeling tentative about the state of Jasmine's NPM module because the last thing stated on the mailing list (march 18th) was "We are working on an official Jasmine NPM that will be a runner that gives this functionality. It's not quite ready yet for alpha testing. We expect it will be in the next few weeks."

infews commented 10 years ago

@juliemr - please take a look at the jasmine-core npm. We've not published it yet, but if you clone the Jasmine repo, you can build the jasmine-core npm and have minijasminenode depend on it to get Jasmine files. We're using it for the jasmine npm (which is a command line runner), so we think we have it in a state where it's useful for other node projects.

Is minijasminenode just an adapter/driver for Protractor at that point? Maybe this repo/project should be renamed?

juliemr commented 10 years ago

@infews I would love to get rid of minijasminenode entirely, I think ideally everything it does should be in jasmine npm - and it sounds like most of it is.

I don't have time to look into jasmine-core myself this week, but since it sounds like you are saying it's pretty much ready to go, I will make time to give it a shot next week.

tonybaroneee commented 10 years ago

:+1:

hahla commented 10 years ago

It's nice that protractor works "off-the-shelf" with minijasminenode, but it does make me concerned about api compatibility. +1 to link protractor to standard jasmine

juliemr commented 10 years ago

@cyrret Any update on jasmine core, the janky require issue, or the status of the jasmine npm module? I'd love to do this update and want to get a sense of the status before I move forward here.

cyrret commented 10 years ago

@juliemr, given your use-case, it seems best for minijasminenode to depend on jasmine-core...rather than deprecate it and migrate to jasmine-npm. @infews can speak more to this, but AFAIK there isn't any active development to support some of the jasmine-node features that minijasminenode exposes. Which janky require issue are you referring to?

juliemr commented 10 years ago

Sorry, should've added context. Require issue is commented in this PR:

// NOTE: this is really janky but a main function will be added in the next 2.x.x release
var jasmineRequire = require('../node_modules/jasmine-core/lib/jasmine-core/jasmine.js');
juliemr commented 10 years ago

Ok, this is now done in the master branch! Looking forward to jasmine exporting more of this functionality itself so that more and more of minijasminenode can go away :)

cyrret commented 10 years ago

Thanks Julie, that's awesome!

Let us know if you need any help / guidance rolling these changes into protractor. When I tried this a few months ago, I had trouble integrating Jasmine 2.0 with jasmine-wd specifically because of how jasmine-wd overrides expect to make async expectations synchronous.

-Terry


Terry Chen tchen120@gmail.com

On Wed, Jun 11, 2014 at 5:49 PM, Julie Ralph notifications@github.com wrote:

Closed #14 https://github.com/juliemr/minijasminenode/pull/14.

— Reply to this email directly or view it on GitHub https://github.com/juliemr/minijasminenode/pull/14#event-130518685.

juliemr commented 10 years ago

@cyrret Do you have any advice around the async expectations? I see that someone once had a Jasmine-as-promised library, which did something similar to Chai-as-promised, but that is for Jasmine 1.x. I've been poking around the new Jasmine 2.0 Expectation object, but don't see an obvious way to cleanly test promises.

Editing for further info: I would be fine with asking people to do something like use an extra property: expect(foo).eventually.toEqual(bar) But I think having a better solution than

foo.then(function(fooValue) {
  expect(fooValue).toEqual(bar);
})

is a requirement.

See https://github.com/angular/jasminewd/pull/5 for current work on updating JasmineWD.

cyrret commented 10 years ago

@juliemr, unfortunately I do not :(. I played around with the protractor code a few months ago but could not find a good way to accomplish what you are currently doing with jasmine-wd. I am wrapping up a project this week and then on vacation for a few days. If you'd like, I may have some cycles towards mid- to end- of next week to ask around and re-open my investigation.


Terry Chen tchen120@gmail.com

On Mon, Jun 16, 2014 at 3:22 PM, Julie Ralph notifications@github.com wrote:

@cyrret https://github.com/cyrret Do you have any advice around the async expectations? I see that someone once had a Jasmine-as-promised library, which did something similar to Chai-as-promised, but that is for Jasmine 1.x. I've been poking around the new Jasmine 2.0 Expectation object, but don't see an obvious way to cleanly test promises.

— Reply to this email directly or view it on GitHub https://github.com/juliemr/minijasminenode/pull/14#issuecomment-46245659 .

juliemr commented 10 years ago

@cyrret that'd be great, whenever you're back this week :)