Commit Graph
36 Commits
Author SHA1 Message Date
Alex StaroselskyandMasahiro Wakame 5b7257019a Exposed angular.mock.module.sharedInjector method for jasmine and mocha testing to take advantage of jasmine's beforeAll() and mocha's before() methods. (#9106) 2016-04-26 00:50:16 +09:00
Anthony CiccarelloandMasahiro Wakame 0ea6c46516 Add ControllerService to angular-mocks (#8889)
* Add ControllerService to angular-mocks

The definition in angular.d.ts changed that used to included this definition.
Needed because of 69d2fb9

* Added unit tests for controller service mock
2016-04-12 22:42:42 +09:00
Jasmin Auger 1cced363c0 Add angular-mocks typings. 2016-03-21 21:13:50 -04:00
vvakame 7de6c3dd94 Merge branch 'master' into rename-repo-url 2016-03-17 21:06:54 +09:00
vvakame 14fe4313f4 replace internal module to namespace 2016-03-17 02:18:10 +09:00
vvakame 56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
vvakame 4de74cb527 normalize line ending (CRLF -> LF) 2016-02-16 01:20:30 +09:00
Stijn Van Nieuwenhuyse 77dd2668f8 add missing ngMockE2E module 2015-09-06 16:46:23 +02:00
Masahiro Wakame 8efeb01304 Merge pull request #5440 from giggio/fixGlobalModule
Remove global `module` definition from angular-mocks
2015-08-28 12:04:37 +09:00
Giovanni Bassi 47b934362a Remove global module definition from angular-mocks
Because it conficts with commonjs.

See http://wiki.commonjs.org/wiki/Modules/1.1:

> In a module, there must be a free variable "module", that is an Object.

Also see the existing `module` declaration on:
https://github.com/borisyankov/DefinitelyTyped/blob/27e02d6674ffe8186a567515b4c157bcf945911e/node/node.d.ts#L61

Workaround is to use `angular.mock.module` instead of `module`.

Closes #2072
2015-08-19 16:47:20 -03:00
tcurtis1 ea24441ae4 Problem with JsonResponseData interface, removed it. 2015-08-04 19:30:56 -06:00
tcurtis1 796e02caac Changes to httpBackend to conform to angular documentation here: https://code.angularjs.org/1.3.16/docs/api/ngMock/service/$httpBackend
Mainly add the option to pass a function in the url parameter. Also updated IRequestHandler interface respond function to return an IRequestHandler, and updated overloads.
Also added documentation.
2015-08-04 15:44:06 -06:00
tcurtis1 57866cd636 Added documentation and updated type definitions for angular mocks httpBackend. 2015-08-04 12:51:36 -06:00
Luke Page 5c6f06e42f angular mocks - global inject is an alias
Adjust the global inject to be an actual alias to the inject definition.
This allows you to use the strict di version globally.
Also updated links to new format.
2015-06-30 14:25:10 +01:00
cherrydev da4009486d Update angular-mocks.d.ts 2015-05-24 10:21:22 -07:00
cherrydev d930a8fc40 Add strictDi() to angular.mocks.inject 2015-05-22 17:26:33 -07:00
vvakame 32194eaa6f add commonjs module declarations to angular 2015-03-17 22:24:15 +09:00
Basarat Ali Syed 8b10d4fbb0 Update angular-mocks.d.ts 2015-03-12 11:43:05 +11:00
Jeremy Bell c71628e076 Adding legacy 1.2 versions of angular-animate, angular-cookies, angular-mocks, angular-resource, angular-route, angular-sanitize, and angular-scenario to address a reference issue when you bring in the 1.2 version of the core angular library. Updated documentation links in the 1.2 versions to point to the 1.2 versions of the documentation. Labeled /angularjs/angular-*.ts as 1.3 in the headers. These will be the starting points for a deeper 1.3 update review - though they are mostly backwards compatible as-is. 2014-11-06 16:10:37 -05:00
Basarat Ali Syed bfeb466418 Update angular-mocks.d.ts
allow 

```ts
angular.mock.module("myApp", function($provide) {
    $provide.value("myService", {
        ...
    });
})
```

Also signature is consistent with the global in the same file: 
```ts
declare var module: (...modules: any[]) => any;
```
2014-07-26 11:35:54 +10:00
Spencer Williams aa2b85affb Added definition for $interval.flush([millis])
ngMock's $interval includes a flush method that takes an optional maximum number of milliseconds to advance the interval, and returns the number of milliseconds that were actually advanced.
2014-06-24 11:51:35 -04:00
Jeremy Bell 9e30ccf2e5 Added overload to angular.mock.inject function to allow array-style dependency injection, which the function supports. Added test excercising the overload. 2014-05-23 17:47:07 -04:00
Jacob Boland 603d36d40c Reimplement earlier changes to header 2013-10-24 12:55:02 -07:00
Jacob Boland f1f15ffd03 Fix parameter types which were actually variable names implicitly defined as any 2013-10-24 12:49:28 -07:00
John Emau 4d3715ca67 reverted accidental removal of author comment from angular-mocks.d.ts 2013-10-24 07:14:18 -07:00
Jared ReynoldsandJohn Emau bf2ed03d80 Added remainder of angular mocks 1.2 definitions 2013-10-23 14:55:46 -07:00
John Emau e06a344578 Merge branch 'update-angularjs' into removing-extraneous-for-daptiv-type-definitions
Conflicts:
	angularjs/angular-mocks.d.ts
2013-10-23 14:55:46 -07:00
Jonathan ParkandJohn Emau 683e94d8d8 Adding angular 1.2 definitions
Conflicts:
	angularjs/angular-mocks.d.ts
2013-10-23 14:55:46 -07:00
unknownandJohn Emau 465dfbaa6e Angular mocks changes for 1.2.0 2013-10-23 14:55:46 -07:00
Santi Albo 922051a6d5 Update documentation for angularjs $httpBackend expect methods.
Both `expect`, `expectPOST`, `expectPUT` and `expectPATCH` can accept:
- string
- RegExp
- function(string)
- Object

This can be seen in https://github.com/angular/angular.js/blob/master/src/ngMock/angular-mocks.js#L1504

Definition will be simpler if we just allow `data` to have type `any`.
2013-08-09 11:50:29 +01:00
vvakame 92d23e046c Update angular-mocks.d.ts
fixed error "error TS1046: 'declare' modifier required for top level element."
2013-06-19 10:55:40 +09:00
Bart Joy ff43d9c144 Added module and inject to the 'global' or 'window' object. 2013-05-10 22:36:14 +12:00
JakubMrozek b807b616d8 angular.mock.inject() return any type 2013-03-07 19:37:45 +01:00
Andrew Davey c086738251 IHttpBackendService#flush count parameter optional
The `count` parameter of `IHttpBackendService#flush` is optional.
2013-03-07 16:34:13 +00:00
Boris Yankov 209d95071a Update reference paths 2013-01-17 20:03:30 +02:00
Boris Yankov c98eebb137 Rename all definition files, remove versions 2013-01-17 17:17:27 +02:00