Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Added mocha support to angular-mocks #1253

Closed
wants to merge 1 commit into from
Closed

Added mocha support to angular-mocks #1253

wants to merge 1 commit into from

Conversation

camwest
Copy link
Contributor

@camwest camwest commented Aug 10, 2012

Hey there,

Here is a simple pull request to add mocha support to angular-mocks. I'm not exactly sure the right way to test this as jasmine is always going to be present in the test suite.

If someone can point me in the right direction I'll implement the proper tests.

@camshaft
Copy link

+1

@mhevery
Copy link
Contributor

mhevery commented Aug 31, 2012

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement).

CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

@camwest
Copy link
Contributor Author

camwest commented Aug 31, 2012

@mhevery I've signed the CLA.

@mhevery
Copy link
Contributor

mhevery commented Sep 4, 2012

MERGED

@camwest
Copy link
Contributor Author

camwest commented Oct 17, 2012

It's true but that code is guarded on a condition which checks for
window.jasmine. isSpecRunning is redefined further down in the mocha
section.

On Wed, Oct 17, 2012 at 11:04 AM, Jack Chu [email protected] wrote:

I'm trying to use this feature, but I'm getting TypeError: Cannot read
property 'running' of undefined.

In angular-mocks.js:

function isSpecRunning() {
return currentSpec && currentSpec.queue.running;
}

I think queue.running is a jasmine only feature. So queue returns
undefined when using mocha.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1253#issuecomment-9530583.

@tazsingh
Copy link

@camwest's angular-mocks.js seems to be different than the one in this repo. This one doesn't redefine isSpecRunning. The commits are different: 92558fe vs https://github.com/camwest/angular.js/commit/bbe0a9c862980a3eb5fa583d21efab06bb2f7ed0

Also, the Jasmine version of isSpecRunning should be using Jasmine's isRunning() function instead of using the value of running directly.

@camwest
Copy link
Contributor Author

camwest commented Oct 20, 2012

Weird. I thought it got merged in.

Cameron Westland

On Saturday, 20 October, 2012 at 10:28 AM, Tasveer Singh wrote:

@camwest (https://github.com/camwest)'s angular-mocks.js seems to be different than the one in this repo. This one doesn't redefine isSpecRunning. The commits are different: 92558fe (92558fe) vs camwest/angular.js@bbe0a9c (https://github.com/camwest/angular.js/commit/bbe0a9c862980a3eb5fa583d21efab06bb2f7ed0)
Also, the Jasmine version of isSpecRunning should be using Jasmine's isRunning() function instead of using the value of running directly.


Reply to this email directly or view it on GitHub (#1253 (comment)).

@tazsingh
Copy link

Yeah me too :)

Maybe @mhevery can take a look?

@cjroebuck cjroebuck mentioned this pull request Nov 18, 2012
@metamatt
Copy link
Contributor

As far as I can tell, #1467 is a real issue and is still correct, and is (as explained above) due to the difference between bbe0a9c (@camwest fork) and 92558fe (what actually got merged to master for 1.1.1).

It hasn't changed since 1.1.1, so it's still broken; I monkey-patched isSpecRunning() to look like 92558fe and that seems to work.

Is it better to use one of the existing issue reports to track this or open a new one?

metamatt added a commit to metamatt/angular.js that referenced this pull request Feb 26, 2013
When running inside Mocha, don't look in Jasmine's spec.queue.running.
It's not there. This is documented as issue angular#1467; I think this issue was
also responsible for angular#1589 and recent complaints in angular#1253.

Closes angular#1467.
IgorMinar pushed a commit that referenced this pull request Feb 26, 2013
When running inside Mocha, don't look in Jasmine's spec.queue.running.
It's not there. This is documented as issue #1467; I think this issue was
also responsible for #1589 and recent complaints in #1253.

Closes #1467.
@mvolkmann
Copy link

I don't think this is fixed in the 1.0.8 version of angular-mocks.js.

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

Successfully merging this pull request may close these issues.

6 participants