Setting environment variable for CHROME_BIN does not work

Was facing the same issue and I solved it by editing the karma.conf.js and karma-e2e.conf.js files which is under config directory. Change: browsers = [‘Chrome’]; TO browsers = [‘Your_System_Path_where_chrome_installed/chrome.exe’]; in my case it was > C:/Program Files (x86)/Google/Chrome/Application/chrome.exe and then add C:\Program Files (x86)\Google\Chrome\Application\chrome.exe path to environment variables or in cmd SET CHROME_BIN = “C:\Program … Read more

How do I fix my generator-angular project so that grunt test works?

I seem to have fixed my problem, for anyone with a similar problem: Within my karma.conf.js I added the following: plugins: [ ‘karma-chrome-launcher’, ‘karma-jasmine’ ], At first I added ‘karma-jasmine’ but was then met with “Can not load “Chrome”, it is not registered!” This was solved by adding ‘karma-chrome-launcher’ as a plug-in Not sure if … Read more

How can I automate both E2E and unit tests with Yeoman & AngularJS?

As I mentioned in a comment to your question – PhantomJS saves a lot of hassle. That aside, I believe you can handle everything from within your Gruntfile and just continue to run grunt test to start the whole thing. grunt-karma allows full customization of your karma options with some handy add-ons. From the docs: … Read more

accessing $scope from unit test file when using the vm “ControllerAs” syntax from AngularJS HotTowel

Ah, obvious now…I can access the vm variable through making a reference to the controller that’s created in the test: it(“should assign Dashboard as title”, function () { var vm = controller(“dashboard”, { $scope: scope }); expect(vm.title).toBe(“Dashboard”); });

Karma: use Windows’ Chrome from WSL

I found that if you create a C:\tmp\karma folder under Windows, this error goes away, and Chrome finds and uses this folder for temp files. You can also change the temporary folder that Chrome uses for its data by setting the TEMP environment variable like so: export TEMP=’/path/to/your/folder’ The important thing is that C:\path\to\your\folder must … Read more