First of allAngularJSIt is very suitable for single-page applications, but it does not mean that karma can only test single-page applications, and can also test non-single-page applications.
unit test
When karma is testing, it will first create a karma configuration file, which contains all the code needed for unit testing, as well as the test code; therefore, although the file is not specified, it is actually included, and you want to test the application For that part of the function, write the function to be tested in the test code.
e2e (end-to-end testing)
Karma's end-to-end testing requires the use of the ng-scenario framework, which runs on the server and does not need to reference all library codes.
First of all
AngularJS
It is very suitable for single-page applications, but it does not mean that karma can only test single-page applications, and can also test non-single-page applications.When karma is testing, it will first create a karma configuration file, which contains all the code needed for unit testing, as well as the test code; therefore, although the file is not specified, it is actually included, and you want to test the application For that part of the function, write the function to be tested in the test code.
Karma's end-to-end testing requires the use of the ng-scenario framework, which runs on the server and does not need to reference all library codes.