Commit Graph

880 Commits

Author SHA1 Message Date
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 3186b24a66 add acceptance tests for mock clock with date 2013-10-25 14:59:07 +02:00
Javier López Pardo 81b822fea9 Add specs for mock date 2013-10-25 14:41:32 +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 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 d0aff9ed02 Use toThrowError instead of toThrow in places where we are expecting an error 2013-10-24 12:15:17 -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 b6eb9a4d5e Remove now unused updateInterval that was being set in specs 2013-10-20 17:12:40 -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 5aaafed4d8 Move clock from global to jasmine; provide a function to access the clock. 2013-10-10 16:24:58 -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
Gregg Van Hove and Tim Jarratt 1c19b8e38a Move spec files back out of spec/javascripts
- Jasmine gem allows us to specify a path to jasmine.yml via ENV

[finish #58126010]
2013-10-02 16:32:35 -07:00
Gregg Van Hove and Rajan Agaskar 5017d1a4f1 Make rake jasmine:ci run specs correctly.
- Will replace rake core_specs.
- Remove obsolete dependencies & files -- most of these were for build tasks we
  are no longer using. Notably, rspec and spec_helper were deleted.
2013-09-25 10:11:02 -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 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 be0f7b4117 EnvSpec for timing out async spec fix
Spec still can't work for maximumSpecCallbackDepth = 1 until further
mock clock enhancements. Fixes the specs running twice issue caused by
the previous commit.
2013-09-02 21:48:44 -07:00
Sheel Choksi edb46a6f7c Fix spec in EnvSpec.js for specs that hang
This spec would hang when maximumSpecCallbackDepth was set to 1
[Fixes #54168730]
2013-09-02 20:39:37 -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 fc409f39a1 Workaround and bug exposure for IE8 and PrettyPrinter, which doesn't work well when trying to pretty print the native timer functions on IE. Make Jasmine's suite green and call out for a fix once we re-write the pretty printer. [Finishes #54168708] 2013-09-01 15:38:14 -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
JR Boyens 9e886b3972 Don't test for stack traces in Safari 5 2013-07-26 17:49:52 -07:00
JR Boyens 98fa58ee49 Async timeout support 2013-07-26 11:27:40 -07:00
Colin O'Byrne and JR Boyens 97ce396008 Build distribution; fix test in FF 2013-07-24 14:41:55 -07:00
Colin O'Byrne and JR Boyens 051f3499ec Revert "[Finishes #45476285] Add timeout support to async tests"
This reverts commit 8f5d0beb8c.

Async timeout support is just not ready for prime time.
2013-07-24 14:39:06 -07:00
Colin O'Byrne and JR Boyens 8f5d0beb8c [Finishes #45476285] Add timeout support to async tests 2013-07-23 17:07:02 -07:00
Colin O'Byrne and JR Boyens 9609aba25f [Finishes #52959947] Warn user about spy conflicts; Refactor spy tests to more reflect responsibilities and removed duplicate tests 2013-07-23 17:00:30 -07:00
Colin O'Byrne and JR Boyens 30aec66ce5 [Finishes #14177231] copy properties onto spy 2013-07-22 14:54:43 -07:00
Colin O'Byrne and JR Boyens 663a58d617 [Finishes #51528655] spies should support and.stub() 2013-07-22 14:39:06 -07:00
Davis W. Frank & Sheel Choksi 3847557bbc Squashed spy refactor and new spy syntax
Jasmine spies now have a 'and' property which allows the user to
change the spy's execution strategy-- such as '.and.callReturn(4)'
and a 'calls' property which allows inspection of the calls a spy
has received.

* This is a breaking change *

There is a CallTracker that keeps track of all calls and arguments
and a SpyStrategy which determines what the spy should do when it
is called.
2013-07-22 14:29:52 -07:00
Colin O'Byrne and JR Boyens 18c30566bd Move from global to Env 2013-07-22 14:29:52 -07:00
Colin O'Byrne and JR Boyens f2306729cd Improve isIE check to allow us to check for a minimum version 2013-07-22 14:22:38 -07:00
Greg Cobb and JR Boyens 8c1881053c Resolve remaining test issues 2013-07-22 11:57:47 -07:00
Davis W. Frank 44feee57ac Merge pull request #394 from albertandrejev/ObjectContaing-message
ObjectContaining wrong filed value error message
2013-07-21 10:30:45 -07:00
JR Boyens 990cc41f45 Remove debugger statement 2013-07-19 18:55:07 -07:00
Greg Cobb and JR Boyens 1b0b4f22a0 Fix IE10 2013-07-19 17:34:04 -07:00