QA/Mozmill Test Automation/Test Modules Refactor: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 36: Line 36:
== Refactoring  ==
== Refactoring  ==


=== Variable Naming ===
=== Constants ===
 
;Contants
 
All ''unchanging'' variables should be declared as constants. All constants should be named in ALL_CAPS with whitespace indicated by an underscore (_). All constants should be declared directly the ''required modules'' block and setupModule() function.  
All ''unchanging'' variables should be declared as constants. All constants should be named in ALL_CAPS with whitespace indicated by an underscore (_). All constants should be declared directly the ''required modules'' block and setupModule() function.  


Example:
<pre>* ***** END LICENSE BLOCK ***** */
<pre>* ***** END LICENSE BLOCK ***** */


// Include required modules var utils = require("../../shared-modules/utils");
// Include required modules  
var utils = require("../../shared-modules/utils");


const TIMEOUT = 5000;
const TIMEOUT = 5000;


var setupModule = function() { </pre>
var setupModule = function() { </pre>
; gDelay
All instances of gDelay should be removed and replaced with a discrete integer.
; gTimeout
All instances of gTimeout should be renamed to TIMEOUT
Confirmed users
14,525

edits

Navigation menu