aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngMock/angular-mocks.js
AgeCommit message (Collapse)Author
2014-03-18style(ngMocks): remove wsIgor Minar
2014-03-18feat(ngMock.$httpBackend): added support for function as URL matcherCaio Cunha
It's now possible to pass a function to match the URL in $httpBackend mocked expectations. This gives a more sophisticate control over the URL matching without requiring complex RegExp mantainance or the workaround of creating an object with a `test` function in order to mimic RegExp interface. This approach was suggested in [this thread](https://groups.google.com/d/msg/angular/3QsCUEvvxlM/Q4C4ZIqNIuEJ) Closes #4580
2014-03-13docs(ngMock): grammar nitpick.Nick Heiner
2014-03-02docs($interval): cancel() takes a promise not a numberMikeMcElroy
Closes #6485
2014-03-02docs(ngMock): fixes in flush() documentationthenickcox
The docs for the `flush()` method contained a few grammatical errors and were awkwardly worded. Change the explanation of the method to remove errors and read more naturally. Closes #4886
2014-02-24perf($animate): use rAF instead of timeouts to issue animation callbacksMatias Niemelä
2014-02-24chore(core): create a wrapper to manage async callbacksMatias Niemelä
2014-02-24chore(core): introduce a wrapper for requestAnimationFrameMatias Niemelä
2014-02-21docs(*): fix anchors for members in api docsPeter Bacon Darwin
2014-02-21docs(ngMock.$interval): fix return descriptionSadaoui Abderrahim
Closes #6384
2014-02-20docs(ngMock): document method ngMock.$interval#cancel()Sadaoui Abderrahim
I have been looking around and was not able to find any informations on how to clear the $interval but reading the source code, sharing is caring! Closes #6367
2014-02-19docs(modules): remove unused {@installModule} tagsPeter Bacon Darwin
2014-02-16docs(bike-shed-migration): let markdown deal with extenal linksPeter Bacon Darwin
It is problematic to use {@link} tags with external links because the markdown parser converts them to links for us before we parse the @links. This means that the following tag: ``` {@link http://www.google.com Google} ``` get converted to: ``` {@link <a href="http://www.google.com/"></a> Google} ``` Our {@link} parser then converts this to: ``` <a href="<a">&lt;</a>href="http://www.google.com/"></a> Google} ``` which is clearly a mess. The best solution is not to use {@link} tags for external links and just use the standard markdown syntax: ``` [Google](http://www.google.com) ``` In the long run, we could look into configuring or modifying `marked` not to convert these external links or we could provide a "pre-parser" processor that dealt with such links before `marked` gets its hands on it.
2014-02-16docs(all): convert <pre>/</pre> snippets to GFM snippetsCaitlin Potter
2014-02-16docs(bike-shed-migration): convert doctype and namesPeter Bacon Darwin
2014-02-14fix($animate): ensure $animate doesn't break natural CSS transitionsMatias Niemelä
BREAKING CHANGE: ngClass and {{ class }} will now call the `setClass` animation callback instead of addClass / removeClass when both a addClass/removeClass operation is being executed on the element during the animation. Please include the setClass animation callback as well as addClass and removeClass within your JS animations to work with ngClass and {{ class }} directives. Closes #6019
2014-02-07revert: refactor(mocks): simplify the `inject` implementationIgor Minar
This reverts commit 64d58a5b5292046adf8b28928950858ab3895fcc. For some weird reason this is causing regressions at Google. I'm not sure why and I'm running out of time to investigate, so I'm taking a safe route here and reverting the commit since it's just a refactoring.
2014-02-06fix(mocks): rename mock.animate to ngAnimateMock and ensure it contains all ↵Matias Niemelä
test helper code for ngAnimate Closes #5822 Closes #5917
2014-02-06fix(mocks): remove usage of $animate.flushNext in favour of queingMatias Niemelä
The flushNext method of testing is difficult and highly coupled with the behavior of ngAnimate's $animate workflow. It is much better instead to just queue all $animate animation calls into a queue collection which is available on the $animate service when mock.animate is included as a module within test code.
2014-02-04fix(ngMock): return false from mock $interval.cancel() when no argument is ↵Daniel Luxemburg
supplied Closes #6103. Closed #6099.
2014-02-03refactor(mocks): simplify the implementationIgor Minar
2014-02-03fix(mocks): always call functions injected with `inject` with `this` set to ↵Wes Alvaro
the current spec Currently when a function is injected inside of a test we set the context to undefined which is a bug. Closes #6102
2014-01-30Edited the 'Flushing HTTP requests' sectionShawn Flahave
Minor grammatical edits in the Flushing HTTP requests section.
2014-01-27fix(mocks): refactor currentSpec to work w/ Jasmine 2John Papa
Closes #5662
2014-01-23docs(ngdoc): ensure module installation docs are accuratePeter Bacon Darwin
The ngMock module is built into a package called angular-mocks, which is not named consistently and the docs were giving invalid info. Closes #5810
2014-01-22docs(ngMock): $log.error property contains messages from $log.error, not ↵gabrielbrasil
$log.log Closes #5932
2014-01-15fix(ngMock): ensure ngAnimate isn't a required mockMatias Niemelä
2014-01-14feat($animate): use requestAnimationFrame instead of a timeout to issue a reflowMatias Niemelä
Closes #4278 Closes #4225
2014-01-06fix(ngMock window.inject): Remove Error 'stack' property changesAndrew C. Greenberg
Recent browsers, particularly PhantomJS 1.9.2 and Safari 7.0 treat the stack property as non-configurable and unwritable. Because window.inject captures the stack at the time of the inject, and attempts to insert it into a captured throw from the injected function by modifying e.stack, a meaningless error message and stack is thrown instead. This commit inserts two tests exposing the problem, and implements a proposed solution that builds a new error-like object that mimicks the old Error object, but with the additional stack information, and captures the toString function from the Error object prototype. This appears to work for the browsers suppoerted here.
2014-01-02fix($httpBackend): use ActiveX XHR when making PATCH requests on IE8Igor Minar
IE8's native XHR doesn't support PATCH requests, but the ActiveX one does. I'm also removing the noxhr error doc because nobody will ever get that error. Closes #2518 Closes #5043
2013-12-11fix(angular-mocks): use copy of mock data in $httpBackendKarl Seamon
Copy mock data returned from the mock $httpBackend. This prevents modifications to the response from affecting future responses. Previously, this misbehavior was being mitigated by the deep copy in $resource, but that no longer exists.
2013-11-26chore(mocks): wrap angular-mocks.js in closureDavid Mosher
Closes #5080
2013-11-21fix(ngMock): fixes httpBackend expectation with body objectCorey Burrows
Fixes an issue with httpBackend expectations where a given body object may not match the actual request body if its keys are serialized in a different order. Closes #4956
2013-11-14chore(mocks): Remove reference to flushNextJames deBoer
Closes #4885
2013-11-06fix(ngMock): throw more descriptive errors for $animate.flushNext()Jeff Cross
2013-10-28fix(angular-mocks): add inline dependency annotationDerek Hammer
Annotation allows the angular-mocks to be minified, which sometimes happens with frameworks that automatically process files before running tests. Also, some developers have been using this library in code for their applications. This is not recommended as the library is only designed to support testing and not production applications. If you are likely to want to use the code here in production you would be best forking and maintaining your own version of the code as we will not guarantee that we won't break the annotation of the code in the future. Closes #4448
2013-10-23chore(ngMocks): shorten the length of the description line to avoid jsHint ↵Matias Niemelä
errors
2013-10-23feat(docs): provide index pages for each angular moduleMatias Niemelä
2013-10-22style: make jshint happyVojta Jina
2013-10-18docs: correct broken linksVojta Jina
This also contains some whitespace corrections by my editor.
2013-10-10fix(modules): stop leaking global variables in testsPete Bacon Darwin
The routeUtils.js file was declaring a number of functions that were leaking into other modules such as ngMocks causing tests to pass incorrectly. Closes #4360
2013-10-09fix(ngMock.$interval): should use angular.isDefinedMark J. Titorenko
The newly introduced `$interval` mock service for ngMock calls `isDefined` in the global namespace which fails when used within unit tests. This change adds the missing `angular.` prefix to such `isDefined` calls. Closes #4334 Closes #4353
2013-10-07feat($interval): add a service wrapping setIntervalJulie
The $interval service simplifies creating and testing recurring tasks. This service does not increment $browser's outstanding request count, which means that scenario tests and Protractor tests will not timeout when a site uses a polling function registered by $interval. Provides a workaround for #2402. For unit tests, repeated tasks can be controlled using ngMock$interval's tick(), tickNext(), and tickAll() functions.
2013-10-07fix(*): protect calls to hasOwnProperty in public APIPeter Bacon Darwin
Objects received from outside AngularJS may have had their `hasOwnProperty` method overridden with something else. In cases where we can do this without incurring a performance penalty we call directly on Object.prototype.hasOwnProperty to ensure that we use the correct method. Also, we have some internal hash objects, where the keys for the map are provided from outside AngularJS. In such cases we either prevent `hasOwnProperty` from being used as a key or provide some other way of preventing our objects from having their `hasOwnProperty` overridden. BREAKING CHANGE: Inputs with name equal to "hasOwnProperty" are not allowed inside form or ngForm directives. Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added to the scope. Now a badname exception is thrown. Using "hasOwnProperty" for an input name would be very unusual and bad practice. Either do not include such an input in a `form` or `ngForm` directive or change the name of the input. Closes #3331
2013-10-02feat(ngMock.$timeout): remove flushNext methodVojta Jina
2013-09-28docs(mocks): fix syntax error in exampleRob Culliton
Closes #4183
2013-09-09docs(mock.inject): fix typoPete Bacon Darwin
2013-09-05docs(mock.inject): document underscore wrapping syntaxJasonM23
Add a summary describing the ignored underscore syntax sugar helper, with a simple use case example. Closes #3621
2013-09-03feat(ngMock): allow passing an object literal as shorthand to moduleMerrick Christensen
2013-08-29fix(ngMocks): $logProvider should not use internal APIsAdam de Baugh
angular.mocks.$LogProvider $logProvider.debugEnabled(false) is crashing with undefined when run inside karma/jasmine test runner: angular.module('foo', []).config(['$logProvider', function ($logProvider) { $logProvider.debugEnabled(false); }]); Closes #3612