-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Unit test broken after: git checkout -f step-7 #203
Comments
Diff got mangled by markdown, second attempt:
|
Clearing out the entire project and fetching again from github, the test works again. Could Firefox be caching old files? When running unit tests, file changes are detected and the tests repeated. However if clearing the project and starting again from scratch has an impact, perhaps caching is leading to false failures. Has this been seen before? |
Having looked at karma setup, could this issue have been caused by the order in which JavaScript files were pushed to the browser? The "files" section includes:
This should load files in alphabetic order. Perhaps the karma.conf.js file should list files in a specific order, so that app.js is loaded before controllers.js. |
Closed issue, since starting from a fresh git checkout worked. Blaming this on cache side effects. |
I adjusted the browsers line in karma.conf.js to use Firefox rather than Chrome.
I'm following the Angular phonecat tutorial using Fedora 20.
https://code.angularjs.org/1.2.26/docs/tutorial/step_07
Running the unit tests with "npm test" and leaving Firefox open shows the effect of each git checkout step. The tests pass for steps 1 to 6, but start failing at step 7.
Error message:
Error: [ng:areq] Argument 'PhoneListCtrl' is not a function, got undefined
Proposed one line fix for controllersSpec.js:
diff --git a/test/unit/controllersSpec.js b/test/unit/controllersSpec.js
index a755e4a..a929b3f 100644
--- a/test/unit/controllersSpec.js
+++ b/test/unit/controllersSpec.js
@@ -6,7 +6,7 @@ describe('PhoneCat controllers', function() {
describe('PhoneListCtrl', function(){
var scope, ctrl, $httpBackend;
beforeEach(inject(function($httpBackend, $rootScope, $controller) {
$httpBackend = $httpBackend;
$httpBackend.expectGET('phones/phones.json').
There are additional failures in further steps - but let's start by fixing this step before tackling others.
Firefox version: 32.0.2
$ node_modules/bower/bin/bower list
bower check-new Checking for new versions of the project dependencies..
angular-phonecat#0.0.0 /angular-phonecat
├── #1.2.26 (1.2.27-build.512+sha.e713f36 available, latest is 1.3.0-rc.5)
├─┬ angular-animate#1.2.26 extraneous (1.2.27-build.512+sha.e713f36 available, latest is 1.3.0-rc.5)
│ └── #1.2.26 (latest is 1.3.0-rc.5)
├─┬ angular-mocks#1.2.26 (1.2.27-build.512+sha.e713f36 available, latest is 1.3.0-rc.5)
│ └── #1.2.26
├─┬ angular-resource#1.2.26 extraneous (1.2.27-build.512+sha.e713f36 available, latest is 1.3.0-rc.5)
│ └── #1.2.26
├─┬ angular-route#1.2.26 (1.2.27-build.512+sha.e713f36 available, latest is 1.3.0-rc.5)
│ └── #1.2.26
├─┬ bootstrap#3.1.1 (latest is 3.2.0)
│ └── jquery#1.10.2 (2.1.1 available)
└── jquery#1.10.2 (latest is 2.1.1)
The text was updated successfully, but these errors were encountered: