linemanjs / lineman-angular-template

A Lineman Application Template using AngularJS
251 stars 88 forks source link

Clean unneeded requires #17

Closed Foxandxss closed 10 years ago

Foxandxss commented 11 years ago

Those requires are not needed anymore :+1:

Closes #16

Foxandxss commented 11 years ago

The thing is, that running protractor by hand (not using the lineman command) it still cries about the require (in this case of jasmine-given and I am not sure why.

Using lineman grunt spec-e2e works just fine.

Is that command adding dependencies to our e2e tests that is not possible with "vanilla protractor"?

searls commented 11 years ago

Precisely. Vanilla protractor gives you no opportunity to require stuff like coffee script. Which means that suite must be run via lineman grunt

On Wed, Oct 9, 2013 at 11:20 AM, Foxandxss notifications@github.com wrote:

The thing is, that running protractor by hand (not using the lineman command) it still cries about the require (in this case of jasmine-given and I am not sure why. Using lineman grunt spec-e2e works just fine.

Is that command adding dependencies to our e2e tests that is not possible with "vanilla protractor"?

Reply to this email directly or view it on GitHub: https://github.com/testdouble/lineman-angular-template/pull/17#issuecomment-25979855

Foxandxss commented 11 years ago

I see the need. That sucks.

If my test needs to use moment, which is not available in a protractor test. That means that I cannot require it?

searls commented 11 years ago

You ought to be able to drop it into spec-e2e/helpers which will be loaded before your specs.

On Oct 9, 2013, at 12:28 PM, Foxandxss notifications@github.com wrote:

I see the need. That sucks.

If my test needs to use moment, which is not available in a protractor test. That means that I cannot require it?

— Reply to this email directly or view it on GitHub.

Foxandxss commented 11 years ago

Which doesn't seem to work. Should I need to import it somehow? And why does that work? I don't see how is that pre-loaded.

searls commented 11 years ago

Short answer: if you're trying to load something before protractor itself gets loaded, you need to do it in a task like I did so I could wedge in CoffeeScript. If you need to load in any code and it's fine that protractor gets loaded first, then a helper file ought to be enough.

What are you trying to require?

On Wed, Oct 9, 2013 at 1:03 PM, Foxandxss notifications@github.com wrote:

Which doesn't seem to work. Should I need to import it somehow? And why does that work? I don't see how is that pre-loaded.

— Reply to this email directly or view it on GitHubhttps://github.com/testdouble/lineman-angular-template/pull/17#issuecomment-25988869 .

Foxandxss commented 11 years ago

I am noob with Protractor and I have a string in my scope created with momentjs so I need to recreate that string (I can't put it by hand) with momentjs but it is not available on my spec files.