aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/angular-mocks.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index 625dcf44..93136698 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -1528,35 +1528,36 @@ window.jasmine && (function(window) {
* Example of what a typical jasmine tests looks like with the inject method.
* <pre>
*
- * angular.module('myTestsModule', [], function($provide) {
- * $provide.value('mode', 'test');
- * });
+ * angular.module('myApplicationModule', [])
+ * .value('mode', 'app')
+ * .value('version', 'v1.0.1');
+ *
*
* describe('MyApp', function() {
*
- * // you can list multiple module function or aliases
- * // which will be used in creating the injector
- * beforeEach(module('myTestModule', function($provide) {
- * // $provide service is configured as needed
- * $provide.value('version', 'v1.0.1');
- * });
+ * // You need to load modules that you want to test,
+ * // it loads only the "ng" module by default.
+ * beforeEach(module('myApplicationModule'));
+ *
*
- * // The inject() is used to get references.
+ * // inject() is used to inject arguments of all given functions
* it('should provide a version', inject(function(mode, version) {
* expect(version).toEqual('v1.0.1');
- * expect(mode).toEqual('test');
- * });
+ * expect(mode).toEqual('app');
+ * }));
+ *
*
* // The inject and module method can also be used inside of the it or beforeEach
- * it('should override a version and test the new version is injected', function(){
+ * it('should override a version and test the new version is injected', function() {
+ * // module() takes functions or strings (module aliases)
* module(function($provide) {
* $provide.value('version', 'overridden'); // override version here
* });
+ *
* inject(function(version) {
* expect(version).toEqual('overridden');
* });
* ));
- *
* });
*
* </pre>