@@ -1528,35 +1528,36 @@ window.jasmine && (function(window) {
1528
1528
* Example of what a typical jasmine tests looks like with the inject method.
1529
1529
* <pre>
1530
1530
*
1531
- * angular.module('myTestsModule', [], function($provide) {
1532
- * $provide.value('mode', 'test');
1533
- * });
1531
+ * angular.module('myApplicationModule', [])
1532
+ * .value('mode', 'app')
1533
+ * .value('version', 'v1.0.1');
1534
+ *
1534
1535
*
1535
1536
* describe('MyApp', function() {
1536
1537
*
1537
- * // you can list multiple module function or aliases
1538
- * // which will be used in creating the injector
1539
- * beforeEach(module('myTestModule', function($provide) {
1540
- * // $provide service is configured as needed
1541
- * $provide.value('version', 'v1.0.1');
1542
- * });
1538
+ * // You need to load modules that you want to test,
1539
+ * // it loads only the "ng" module by default.
1540
+ * beforeEach(module('myApplicationModule'));
1541
+ *
1543
1542
*
1544
- * // The inject() is used to get references.
1543
+ * // inject() is used to inject arguments of all given functions
1545
1544
* it('should provide a version', inject(function(mode, version) {
1546
1545
* expect(version).toEqual('v1.0.1');
1547
- * expect(mode).toEqual('test');
1548
- * });
1546
+ * expect(mode).toEqual('app');
1547
+ * }));
1548
+ *
1549
1549
*
1550
1550
* // The inject and module method can also be used inside of the it or beforeEach
1551
- * it('should override a version and test the new version is injected', function(){
1551
+ * it('should override a version and test the new version is injected', function() {
1552
+ * // module() takes functions or strings (module aliases)
1552
1553
* module(function($provide) {
1553
1554
* $provide.value('version', 'overridden'); // override version here
1554
1555
* });
1556
+ *
1555
1557
* inject(function(version) {
1556
1558
* expect(version).toEqual('overridden');
1557
1559
* });
1558
1560
* ));
1559
- *
1560
1561
* });
1561
1562
*
1562
1563
* </pre>
0 commit comments