I have an AngularJS 1.5.11 app where RequireJS 2.2.0 is used everywhere. Unit tests are needed. And I can't get even a dummy test executed. Please advise.
The error:
PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (0.044 secs / 0 secs)
Detailed debug level output from karma start --browsers PhantomJS_custom --log-level debug command: https://gist.github.com/sergibondarenko/1120d211aa2265b76669cd831495a6c1
Test: app/controllers/__tests__/loginController.spec.js
define('loginController', [], function () {
describe('loginController', function () {
it('dymmy test', function () {
expect(true).toBe(false);
});
});
});
Karma config: https://gist.github.com/sergibondarenko/4b305341faa24883cb90e6f8f7490d74
Test-main: https://gist.github.com/sergibondarenko/6aa25bf71bfadf39883a59d7cda57a65
Dev dependencies:
:~/dev/qxip/hepic$ grep -rn devD package.json -A 9
20: "devDependencies": {
21- "jasmine": "^2.8.0",
22- "jasmine-core": "^2.4.1",
23- "karma": "^0.13.22",
24- "karma-browserify": "^5.1.1",
25- "karma-jasmine": "^0.3.8",
26- "karma-phantomjs-launcher": "^1.0.4",
27- "protractor": "^4.0.9",
28- "watchify": "^3.9.0"
29- },
The app structure is below. Some libs are in node_modules, other libs are in lib folder.
user@host:~/dev$ tree -L 1 theapp
theapp
├── app
├── css
├── font-awesome
├── fonts
├── img
├── index.html
├── karma.conf.js
├── lang
├── lib
├── node_modules
├── package.json
├── README.md
├── resources
├── scripts
├── share
├── templates
├── test-main.js
├── tests
└── widgets
Please tell me if you need more info.
karma start --browsers PhantomJS_custom --log-level debugfrom my app root folder -~/dev/theapp. The complete path for the test-main.js is~/dev/theapp/test-main.js, please look the app structure above./app/test/and then add your test file astest-file.spec.js. Let me know if that works.