Commit Graph

2567 Commits

Author SHA1 Message Date
Christopher Jobst 78bed99ba3 Add in 2.0 release notes 2013-12-16 11:17:51 -08:00
pimterry b1d4ab09af Add tests for call return value tracking 2013-12-08 13:40:25 +00:00
pimterry 3b52d015ea Track return values of spy functions 2013-12-08 13:40:24 +00:00
Sheel Choksi f9191d7b0d Merge pull request #473 from pimterry/callTrackingTests
Refactored the createSpy tests, to add unit tests for its part of call tracking
2013-12-07 16:57:57 -08:00
pimterry 83a692d5a8 Use the correct Jasmine version in the spy integration tests 2013-12-07 22:16:24 +00:00
pimterry 14a8c2ca09 Move spy integration tests out of the unit test suite 2013-12-07 20:52:02 +00:00
pimterry b2e8de7bcd Mock callTracker in spy tests for better test isolation 2013-12-07 20:43:38 +00:00
pimterry 1d98a23b14 Add tests for call tracking in createSpy 2013-12-07 20:27:08 +00:00
Sheel Choksi 16ffd3b3fb Fix up specs that failed when maximumSpecCallbackDepth is set to 1 2013-11-22 23:04:42 -08:00
Sheel Choksi 6bc87ad223 Merge pull request #466 from
maciej-filip-sz:DelayedFunctionScheduler-patch

Sets and executes timeouts set during a tick.
2013-11-17 17:17:31 -08:00
Maciej Filip Szkodziński 555d328cf2 Moved last currentTime assignment to tick. 2013-11-17 17:14:29 -08:00
Maciej Filip Szkodziński c78fba4b13 Sets and executes timeouts set during a tick.
All timeouts and intervals set during a tick were being scheduled to run
at delay + end-of-tick, instead of delay + time-of-outer-timeout.

Scheduled run-at times were shifted because currentTime was being
incremented before executing scheduled functions.

Additionally, the execute loop was iterating over a functions-to-run
array, created from scheduledFunctions before starting. Any changes to
scheduledFunctions were being ignored during the tick, and the next tick
would ignore any functions which should have been executed in the past.

The commit is a rewrite of DelayedFunctionScheduler, preserving the
public interface. Execution of scheduled functions updates currentTime
on each iteration, and each time takes the functions with the lowest
runAtMillis from the schedule, if they aren't higher than endTime.
2013-11-17 17:14:29 -08:00
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 72e9851217 Bumping built distribution 2013-11-14 18:16:32 -08:00
Sheel Choksi 7ee5073921 Fix bad merge 2013-11-11 21:01:36 -08:00
Sheel Choksi 614a18453e Rename Spec's queueRunner to more accurately be a queueRunnerFactory 2013-11-11 20:53:13 -08:00
Rajan Agaskar 916f889c01 Merge pull request #462 from tidoust/clear-timeout-async
Clears timeout timer even when async spec throws an exception
2013-11-07 09:40:43 -08:00
François Daoust 4a7b79ad0d Regression spec added for timeout timer in an async spec
The spec ensures that the timeout timer is properly cleared out
even when the async spec throws an exception.
2013-11-07 16:08:41 +01: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
Sheel Choksi 1b6725ec25 Updating Spec#getFullName spec to work in IE 8
Forgot that the pretty printer is not functional in IE 8, which
subsequently brings down toHaveBeenCalledWith
2013-11-04 21:59:06 -08:00
Sheel Choksi 952eb59707 Change test for how a spy gets its full name
- Removes another TODO
- A spec uses its full name as soon as it is created (for the result
    object) and so it needed to be tested differently
2013-11-04 21:38:01 -08:00
Sheel Choksi de6a305b44 Move the various integration specs into their own folder
- There is now an integration folder inside of spec/core
- Killed the TODOs about moving around integration specs
2013-11-03 16:48:35 -08:00
Sheel Choksi 8513201fa3 Add in missing repository field to package.json
Removes the following warning when doing a `npm install`: 'npm WARN
package.json jasmine-core@2.0.0-rc5 No repository field.'
2013-11-02 18:28:53 -07: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
JR and Sheel Choksi fcc50cc6f4 Rename Release.markdown to be more consistently named 2013-10-31 14:27:30 -07:00
Sheel Choksi 9e8466ba2b Merge pull request #458 from jsoref/readme
Rename README for consistency
2013-10-31 14:24:43 -07:00
Kristóf Marussy 4350045d61 Replaced deprecated octal literal with hexadecimal
Octal literals are deprecated in JavaScript 1.5 and Gjs were generating
warnings because of them.
2013-10-31 14:03:06 -07:00
Rajan Agaskar 666e9c341e Merge pull request #460 from jsoref/releasenotes
Improving Release note text
2013-10-30 20:52:30 -07:00
Josh Soref 5830d9f86b Improving Release note text 2013-10-30 23:14:57 -04:00
August Toman-Yih and Sheel Choksi ea888e4c03 Fix triple/tripple spelling error 2013-10-30 17:30:25 -07:00
Josh Soref c7e3ca6c8a Spelling: Fix spelling errors
* equal
* existence
* expectation
* expected
* intend
* message
* report
* singular
2013-10-30 20:12:05 -04:00
Josh Soref 06db4a8583 Rename README for consistency 2013-10-30 10:31:15 -04:00
Rajan Agaskar and Sheel Choksi a2debf60b6 Use jasmine.addMatchers instead of reaching through jasmine.Expectation [finishes #59518946] 2013-10-29 18:35:17 -07:00
Sheel Choksi 04c7db9259 Update built distribution to include latest 2.0.0-rc5 fixes v2.0.0.rc5 2013-10-29 17:40:15 -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 cb5aea1fcf Fix builds by working around browser timing functions not being successfully overridden 2013-10-29 17:32:04 -07:00
Sheel Choksi 966f76b481 Add in missing clock uninstall 2013-10-29 17:28:41 -07:00
Sheel Choksi 40e3020fdc Build distribution for 2.0.0-rc5 and associated standalone distribution 2013-10-29 14:03:02 -07:00
Sheel Choksi 69549a6ff3 Add in 2.0.0-rc5 release notes 2013-10-29 14:03:01 -07:00
Sheel Choksi a03fad8911 Move built console.js into lib and include in standalone distribution
[finishes #59679110]
2013-10-29 14:03:01 -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 dd8a455f91 Adding Code Climate badge to README 2013-10-25 12:25:27 -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 3186b24a66 add acceptance tests for mock clock with date 2013-10-25 14:59:07 +02:00