Sheel Choksi
8a6d7828c6
Make all async functions be subject to the timeout
...
[finishes #60798058 ]
2013-11-14 23:01:43 -08:00
Sheel Choksi
c888b0c1b8
Slight refactoring of clearing timeouts when an exception is thrown
2013-11-14 20:48:28 -08:00
Sheel Choksi
614a18453e
Rename Spec's queueRunner to more accurately be a queueRunnerFactory
2013-11-11 20:53:13 -08:00
François Daoust
775e2ff0a9
Clears timeout timer even when async spec throws an exception
...
When an async spec throws a (sync) exception for some reason, the
exception was correctly caught and reported by Jasmine but the timeout
timer continued to run in the background.
For instance, running the (rather stupid) example below would report
the exception immediately but would also make the process loop for 5s
(and report the exception depending on the reported being used).
describe('exception', function () {
it('is caught but timer continues to run', function (done) {
throw new Error('Oh no!');
});
});
This happened because the timout timer is set in Spec while the
"try... catch" block is in the queue runner. The "callDone" function
of "timeoutable" that resets the timer was thus not called.
The commit simply introduces a "try... catch" block within the
`timeoutable` function to ensure that "callDone" gets called even
when an exception is thrown.
2013-11-07 14:51:46 +01:00
JR and Sheel Choksi
6e07dccb68
Make getGlobal() work in strict mode
...
Slight modifications to implementation in pull #437
2013-11-01 11:06:57 -07:00
Sheel Choksi
8585ef69a5
Update clock not installed message to reflect current boot installation process
2013-10-29 17:33:51 -07:00
Sheel Choksi
61993cf1fc
Expose Jasmine's topSuite [finishes #59774024 ]
2013-10-29 11:27:12 -07:00
Kyriacos Souroullas and Sheel Choksi
cd9d5284cd
Matchers can have a negativeCompare
...
- Passing in a 'negativeCompare' will cause that function to be used when it is a 'not' assertion
- Otherwise, the reversal of the compare's result will be used instead
[finishes #59703824 ]
2013-10-28 17:13:18 -07:00
Kyriacos Souroullas and Sheel Choksi
e346e7dcc1
Revert removal of compare nesting
...
Since we want the user to be able to pass a negative comparison function, the extra layer of wrapping is now needed
2013-10-28 17:13:09 -07:00
Davis W. Frank
9e149d1e0f
Move node dev deps forward, add .jshintrc to support latest grunt-contrib-jshint and Code Climate score
2013-10-25 12:23:57 -07:00
Sheel Choksi and Tim Jarratt
797984f173
Add newlines to end of files
2013-10-25 10:57:43 -07:00
Sheel Choksi and Tim Jarratt
29c5c127e5
Refactor Suite.addSpec and .addSuite to .addChild
2013-10-25 10:52:31 -07:00
Sheel Choksi and Tim Jarratt
26581b4c91
Rename Suite.children_ to .children
...
Also removed some unit tests that were brittle, and already tested by
better, more round-trip tests.
2013-10-25 10:25:50 -07:00
Javier López Pardo
81b822fea9
Add specs for mock date
2013-10-25 14:41:32 +02:00
Javier López Pardo
fb8bede8ea
Add FakeDate object
2013-10-25 13:25:09 +02:00
Davis W. Frank
243ff80196
Fixing global leak for 'timer'
2013-10-24 17:17:05 -07:00
Sheel Choksi
6453ed656b
Suites just have children instead of separating into specs/suites
2013-10-24 16:35:00 -07:00
Sheel Choksi
a1a948b8df
Remove completeCallback from suite as its unused
2013-10-24 16:34:34 -07:00
Sheel Choksi
7a4876ecfa
Also move function to determine whether specs should catch exceptions into closure
2013-10-24 16:24:55 -07:00
Sheel Choksi
d9ece1f14f
Remove version/versionString and currentRunner
...
- Instead of version/versionString, jasmine.version should be sufficient
- currentRunner was exposing Jasmine's internal top level suite
2013-10-24 15:42:46 -07:00
Sheel Choksi
f1613ce77c
Move additional methods from Env prototype to env closure
...
- Users can no longer spelunk the spec tree from topSuite
- Users no longer have access to currentSuite/currentSpec
- Other miscellaneous (arguably less useful) methods have also been tucked
away into the closure, like suiteFactory
2013-10-24 15:28:01 -07:00
Sheel Choksi
ab0b2b783c
Move next spec/next suite ids into closure
...
No longer exposing these from the environment
2013-10-24 13:43:04 -07:00
Sheel Choksi
a309117758
Remove TODO: should be easier to load polyfill for timeout functions as Jasmine does not get references to these functions until boot.js is loaded
2013-10-24 11:58:21 -07:00
Sheel Choksi
0c6e590a93
A spec without expectations is considered passing
...
- Specs are passing by default unless told otherwise
- Getting the result.status of a spec before the spec has run is now
undefined instead of pending
[finishes #59422744 ]
2013-10-24 11:34:42 -07:00
Sheel Choksi
39d7ebf28e
Remove an extra layer of wrapping for matchers/custom matchers
...
Helps reduce how nested custom matchers have to be for users as well as
Jasmine internal matchers
[#59161378 ]
2013-10-20 22:21:56 -07:00
Sheel Choksi
5f429fcb37
Re-enable CustomMatchersSpec and update for current version of custom matchers
2013-10-20 21:58:16 -07:00
Sheel Choksi
fdb7df812c
Improve error message when a spec doesn't call the async callback within the default time interval
2013-10-19 21:18:06 -07:00
Davis W. Frank
81299860aa
Merge pull request #450 from slackersoft/manualClockUninstall
...
Env no longer automatically uninstalls the clock after each spec
2013-10-18 15:51:10 -07:00
slackersoft
ca6fa6f711
Env no longer automatically uninstalls the clock after each spec
...
- Behaves more like how we want plugins to behave
[#58281436 ]
2013-10-16 18:39:03 -07:00
Davis W. Frank
8ca8197b4c
Make exposure of addMatchers and addCustomEqualityTesters be on jasmine instead of inconsistent.
2013-10-10 11:32:21 -07:00
slackersoft
6641d64305
Make addCustomEqualityTester available on jasmine global
...
- User shouldn't have to `jasmine.getEnv()` to add one
[#54582648 ]
2013-10-06 11:32:38 -07:00
Gregg Van Hove and Tim Jarratt
af4bfa8bc4
Env should use the "public" QueueRunner interface
2013-10-04 17:04:22 -07:00
slackersoft
b5b77b318a
Argument matcher for an array containing at least the specified entries
2013-10-03 18:21:47 -07:00
Gregg Van Hove and Tim Jarratt
7e071547f5
Custom matchers fail to behave as expected
...
If they return false, that should be respected.
Submitted via @tjgrathwell
[Finish #58184156 ]
close #434
2013-10-03 15:13:27 -07:00
Davis W. Frank
0c4113e167
Quick fix - Spec needs j$ at execute time
2013-10-02 22:45:33 -07:00
Mike Stay
ffa6138d75
Make getGlobal() work in strict mode
...
An update of fb3e1acb09
ES5 strict mode does not promote an undefined 'this' to the global object. The only way to get the global object in strict mode is to say 'this' while in the global scope.
2013-10-02 12:38:25 -06:00
Gregg Van Hove and Tim Jarratt
cb8ba74937
Don't add periods to the full name of a spec
...
- Breaks links for spec filters
- Looks strange if users add their own
[fix #58043244 ] fix #427
2013-10-01 16:28:33 -07:00
Sheel Choksi
da33c7823e
Add missing var in front of j$ to avoid polluting global namespace
...
Users should only have 'jasmine' in global namespace, j$ should be
fully internal unless developing for jasmine
As brought up by Morten Maxild
2013-09-29 14:46:55 -07:00
Sheel Choksi
efc384c6d6
Allow Env to take optional spec/suite ids when asked to execute
2013-09-17 19:55:49 -07:00
Sheel Choksi
d60786a06c
More clearly differentiate between spec and suite ids
2013-09-17 19:55:48 -07:00
Sheel Choksi
8ac085c103
Use jasmine.DEFAULT_TIMEOUT_INTERVAL for async timeout
...
Allows a user to specify their desired timeout interval for async specs
and change it on a per spec basis (for particularly slow specs, for example).
As pointed out by @Eric-Wright in #422 . [finishes #55996798 ]
2013-09-08 21:41:45 -07:00
Sheel Choksi
03dfea967c
Remove unused jasmine.DEFAULT_UPDATE_INTERVAL
2013-09-08 14:18:34 -07:00
Sheel Choksi
f463e1f7aa
Consistent 'this' between befores/it/afters
...
Change the 'this' user functions are called with to be an empty object
instead of the QueueRunner so that if the user puts properties on it,
they won't conflict.
Also, changes async specs to be called with a proper 'this', as pointed
out by @Eric-Wright in #419 and #420 .
[finishes #56030080 ]
2013-09-07 18:28:03 -07:00
Sheel Choksi
4bff199c2a
Rename a spy's callReturn and callThrow
...
.and.callReturn is now .and.returnValue
.and.callThrow is now .and.throwError
[finishes #56281634 ]
2013-09-06 21:55:14 -07:00
Sheel Choksi
e3f0389ac2
Change andThrow to always throw an Error
...
If an error is passed in, it is thrown, otherwise the argument passed
in is wrapped in an Error
[finishes #50607615 ][closes #372 ]
2013-09-05 23:05:45 -07:00
Sheel Choksi
a442acb8aa
Mock Clock now correctly schedules delayed functions during a 'tick'
2013-09-02 18:50:17 -07:00
Davis W. Frank
ba55cb5e38
Mock clock now less intrusive, replacing global timer funcions only when clock is installed. [ Fixes #54168708 ]
2013-08-27 22:46:01 -07:00
Sheel Choksi
5ba6e51e1c
Restore custom failure messages for toHaveBeenCalledWith
...
As pointed out by @tjgrathwell
2013-08-26 23:24:43 -07:00
Sheel Choksi
0f42f2709a
Update PrettyPrinter to better check for an Object
...
Includes test case to fix FF as suggested by @ondras
Fixes #409
2013-08-03 11:49:20 -07:00
Davis W. Frank and Sheel Choksi
66d9b3d690
Moving call depth down to a lower number to increase CI stability at the expense of performance.
2013-07-28 17:01:49 -07:00