joomla-projects / gsoc17_js_tests

GSoC17 JS tests for Joomla 4
GNU General Public License v2.0
1 stars 1 forks source link

Removed document.ready closure inside IIFE function #43

Open Supun94 opened 7 years ago

Supun94 commented 7 years ago

Pull Request for Issue #42 .

Ruchiranga commented 7 years ago

This does not look right @Supun94. If It is the $(document).ready() callback function that you are trying to test, what you need to do is assign that callback function to a variable such that it would be accessible by the tests and call it manually before running the tests. Removing the whole document.ready() thing would break the code since that code would now run before the document is ready :stuck_out_tongue:

Supun94 commented 7 years ago

@Ruchiranga inside the IIFE parent function we don't need the $(document).ready() callback. Because IIFE doesn't execute the code in $(document).ready() . Please go through this link and please correct me if this approach is wrong 🙂