-
Notifications
You must be signed in to change notification settings - Fork 5
Jasmine FAQ (Unit Testing)
The tests will be designed and implemented based on the requirements and functions of the software application. Using a test-driven approach to ensure the software comply with the intended usage (validation) and it fulfills the requirements (verification). Some area of testing that can be done including user inputs, database integrity, and source code reachability using different sets of coverage criterion. These are also things that should be tested to ensure all the test requirements are satisfied, which are derived based on the functionality of this software.
Jasmine provides an organized and consistent way inside each describe() function using the beforeEach() function to setup state before running each test and afterEach() function to teardown the remaining state after running each test inside a spec. These two functions are not required to have inside the describe() function, however, it is definitely important to put the system under the state that is necessary to run a test correctly.
describe(name,function) - a function for grouping related specs with a given name.
Most of the behavior that I want to test depends on data loaded from Firebase in the cloud. How do I test this?
I'm writing some functionality in a new JS file. Is there a convention on where I should put the corresponding tests in the file structure?
Below are sources where I referenced most of the information for creating this wiki page. You will be able to learn most of important usage related details through the link of Jasmine Introduction.
- History/Background (http://www.htmlgoodies.com/beyond/javascript/testing-javascript-using-the-jasmine-framework.html)
- Jasmine Introduction (http://jasmine.github.io/2.0/introduction.html)
- Jasmine on Github (https://github.com/jasmine/jasmine)