Make WordPress Core

Changeset 26040


Ignore:
Timestamp:
11/07/2013 08:40:12 PM (11 years ago)
Author:
nacin
Message:

Use only one var per scope in our password-strength-meter tests.

props kadamwhite.
see #25187.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/qunit/wp-admin/js/password-strength-meter.js

    r25992 r26040  
    1313    test( 'long complicated passwords should return 4', function() {
    1414        var password = function( length ) {
    15             var possibility = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
    16                 retVal = '';
    17             for ( var i = 0, n = possibility.length; i < length; i++ ) {
     15            var i, n, retVal = '',
     16                possibility = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
     17            for ( i = 0, n = possibility.length; i < length; i++ ) {
    1818                retVal += possibility.charAt( Math.floor( Math.random() * n ) );
    1919            }
     
    3737
    3838    test( 'zxcvbn password tests should return the score we expect', function() {
    39         var passwords = [
     39        var passwords, i;
     40        passwords = [
    4041            { pw: 'zxcvbn', score: 0 },
    4142            { pw: 'qwER43@!', score: 1 },
     
    7475        ];
    7576
    76         for ( var i = 0; i < passwords.length; i++ ) {
     77        for ( i = 0; i < passwords.length; i++ ) {
    7778            equal( passwordStrength( passwords[i].pw, 'username', passwords[i].pw ), passwords[i].score, 'password of `' + passwords[i].pw + '` returns ' + passwords[i].score );
    7879        }
Note: See TracChangeset for help on using the changeset viewer.