Make WordPress Core

Changeset 47512


Ignore:
Timestamp:
03/27/2020 12:16:58 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Update QUnit and Sinon to the latest versions.

Update JS tests per the QUnit 2.x Upgrade Guide.

Fixes #37117.

Location:
trunk
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/package-lock.json

    r47497 r47512  
    18311831            "optional": true
    18321832        },
     1833        "@sinonjs/commons": {
     1834            "version": "1.7.1",
     1835            "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz",
     1836            "integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==",
     1837            "dev": true,
     1838            "requires": {
     1839                "type-detect": "4.0.8"
     1840            }
     1841        },
     1842        "@sinonjs/fake-timers": {
     1843            "version": "6.0.0",
     1844            "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.0.tgz",
     1845            "integrity": "sha512-atR1J/jRXvQAb47gfzSK8zavXy7BcpnYq21ALon0U99etu99vsir0trzIO3wpeLtW+LLVY6X7EkfVTbjGSH8Ww==",
     1846            "dev": true,
     1847            "requires": {
     1848                "@sinonjs/commons": "^1.7.0"
     1849            }
     1850        },
     1851        "@sinonjs/formatio": {
     1852            "version": "5.0.1",
     1853            "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz",
     1854            "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==",
     1855            "dev": true,
     1856            "requires": {
     1857                "@sinonjs/commons": "^1",
     1858                "@sinonjs/samsam": "^5.0.2"
     1859            }
     1860        },
     1861        "@sinonjs/samsam": {
     1862            "version": "5.0.3",
     1863            "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.3.tgz",
     1864            "integrity": "sha512-QucHkc2uMJ0pFGjJUDP3F9dq5dx8QIaqISl9QgwLOh6P9yv877uONPGXh/OH/0zmM3tW1JjuJltAZV2l7zU+uQ==",
     1865            "dev": true,
     1866            "requires": {
     1867                "@sinonjs/commons": "^1.6.0",
     1868                "lodash.get": "^4.4.2",
     1869                "type-detect": "^4.0.8"
     1870            }
     1871        },
     1872        "@sinonjs/text-encoding": {
     1873            "version": "0.7.1",
     1874            "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz",
     1875            "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==",
     1876            "dev": true
     1877        },
    18331878        "@tannin/compile": {
    18341879            "version": "1.1.0",
     
    45904635                    "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==",
    45914636                    "dev": true,
    4592                     "optional": true,
    45934637                    "requires": {
    45944638                        "p-finally": "^1.0.0"
     
    46354679            "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
    46364680            "dev": true,
    4637             "optional": true,
    46384681            "requires": {
    46394682                "readable-stream": "^2.3.5",
     
    49284971            "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
    49294972            "dev": true,
    4930             "optional": true,
    49314973            "requires": {
    49324974                "buffer-alloc-unsafe": "^1.1.0",
     
    49384980            "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
    49394981            "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
    4940             "dev": true,
    4941             "optional": true
     4982            "dev": true
    49424983        },
    49434984        "buffer-crc32": {
     
    49454986            "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
    49464987            "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
    4947             "dev": true,
    4948             "optional": true
     4988            "dev": true
    49494989        },
    49504990        "buffer-fill": {
     
    49524992            "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
    49534993            "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=",
    4954             "dev": true,
    4955             "optional": true
     4994            "dev": true
    49564995        },
    49574996        "buffer-from": {
     
    52135252            "integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==",
    52145253            "dev": true,
    5215             "optional": true,
    52165254            "requires": {
    52175255                "get-proxy": "^2.0.0",
     
    53485386                },
    53495387                "minimist": {
    5350                     "version": "1.2.0",
    5351                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    5352                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     5388                    "version": "1.2.5",
     5389                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     5390                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    53535391                    "dev": true
    53545392                },
     
    57885826            "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
    57895827            "dev": true,
    5790             "optional": true,
    57915828            "requires": {
    57925829                "ini": "^1.3.4",
     
    64796516                },
    64806517                "minimist": {
    6481                     "version": "1.2.0",
    6482                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    6483                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     6518                    "version": "1.2.5",
     6519                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     6520                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    64846521                    "dev": true
    64856522                },
     
    65546591            "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=",
    65556592            "dev": true,
    6556             "optional": true,
    65576593            "requires": {
    65586594                "decompress-tar": "^4.0.0",
     
    65716607                    "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
    65726608                    "dev": true,
    6573                     "optional": true,
    65746609                    "requires": {
    65756610                        "pify": "^3.0.0"
     
    65806615                            "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
    65816616                            "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
    6582                             "dev": true,
    6583                             "optional": true
     6617                            "dev": true
    65846618                        }
    65856619                    }
     
    65896623                    "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
    65906624                    "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
    6591                     "dev": true,
    6592                     "optional": true
     6625                    "dev": true
    65936626                }
    65946627            }
     
    65996632            "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
    66006633            "dev": true,
    6601             "optional": true,
    66026634            "requires": {
    66036635                "mimic-response": "^1.0.0"
     
    66096641            "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==",
    66106642            "dev": true,
    6611             "optional": true,
    66126643            "requires": {
    66136644                "file-type": "^5.2.0",
     
    66206651                    "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
    66216652                    "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
    6622                     "dev": true,
    6623                     "optional": true
     6653                    "dev": true
    66246654                }
    66256655            }
     
    66306660            "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==",
    66316661            "dev": true,
    6632             "optional": true,
    66336662            "requires": {
    66346663                "decompress-tar": "^4.1.0",
     
    66436672                    "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz",
    66446673                    "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==",
    6645                     "dev": true,
    6646                     "optional": true
     6674                    "dev": true
    66476675                }
    66486676            }
     
    66536681            "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
    66546682            "dev": true,
    6655             "optional": true,
    66566683            "requires": {
    66576684                "decompress-tar": "^4.1.1",
     
    66646691                    "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
    66656692                    "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
    6666                     "dev": true,
    6667                     "optional": true
     6693                    "dev": true
    66686694                }
    66696695            }
     
    66746700            "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=",
    66756701            "dev": true,
    6676             "optional": true,
    66776702            "requires": {
    66786703                "file-type": "^3.8.0",
     
    66876712                    "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
    66886713                    "dev": true,
    6689                     "optional": true,
    66906714                    "requires": {
    66916715                        "pend": "~1.2.0"
     
    66966720                    "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
    66976721                    "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=",
    6698                     "dev": true,
    6699                     "optional": true
     6722                    "dev": true
    67006723                },
    67016724                "get-stream": {
     
    67046727                    "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=",
    67056728                    "dev": true,
    6706                     "optional": true,
    67076729                    "requires": {
    67086730                        "object-assign": "^4.0.1",
     
    67146736                    "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
    67156737                    "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
    6716                     "dev": true,
    6717                     "optional": true
     6738                    "dev": true
    67186739                },
    67196740                "yauzl": {
     
    67226743                    "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
    67236744                    "dev": true,
    6724                     "optional": true,
    67256745                    "requires": {
    67266746                        "buffer-crc32": "~0.2.3",
     
    69016921                },
    69026922                "kind-of": {
    6903                     "version": "6.0.2",
    6904                     "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
    6905                     "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
     6923                    "version": "6.0.3",
     6924                    "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
     6925                    "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
    69066926                    "dev": true
    69076927                }
     
    72287248                    "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
    72297249                    "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
    7230                     "dev": true,
    7231                     "optional": true
     7250                    "dev": true
    72327251                }
    72337252            }
     
    72617280            "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
    72627281            "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
    7263             "dev": true,
    7264             "optional": true
     7282            "dev": true
    72657283        },
    72667284        "duplexify": {
     
    82538271            "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
    82548272            "dev": true,
    8255             "optional": true,
    82568273            "requires": {
    82578274                "cross-spawn": "^5.0.1",
     
    84168433            "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==",
    84178434            "dev": true,
    8418             "optional": true,
    84198435            "requires": {
    84208436                "mime-db": "^1.28.0"
     
    84268442            "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==",
    84278443            "dev": true,
    8428             "optional": true,
    84298444            "requires": {
    84308445                "ext-list": "^2.0.0",
     
    86978712            "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz",
    86988713            "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=",
    8699             "dev": true,
    8700             "optional": true
     8714            "dev": true
    87018715        },
    87028716        "filenamify": {
     
    87058719            "integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==",
    87068720            "dev": true,
    8707             "optional": true,
    87088721            "requires": {
    87098722                "filename-reserved-regex": "^2.0.0",
     
    90989111            "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
    90999112            "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
    9100             "dev": true,
    9101             "optional": true
     9113            "dev": true
    91029114        },
    91039115        "fs-exists-sync": {
     
    91559167                    "version": "2.1.1",
    91569168                    "bundled": true,
    9157                     "dev": true,
    9158                     "optional": true
     9169                    "dev": true
    91599170                },
    91609171                "aproba": {
     
    91779188                    "version": "1.0.0",
    91789189                    "bundled": true,
    9179                     "dev": true,
    9180                     "optional": true
     9190                    "dev": true
    91819191                },
    91829192                "brace-expansion": {
     
    91849194                    "bundled": true,
    91859195                    "dev": true,
    9186                     "optional": true,
    91879196                    "requires": {
    91889197                        "balanced-match": "^1.0.0",
     
    91999208                    "version": "1.1.0",
    92009209                    "bundled": true,
    9201                     "dev": true,
    9202                     "optional": true
     9210                    "dev": true
    92039211                },
    92049212                "concat-map": {
    92059213                    "version": "0.0.1",
    92069214                    "bundled": true,
    9207                     "dev": true,
    9208                     "optional": true
     9215                    "dev": true
    92099216                },
    92109217                "console-control-strings": {
    92119218                    "version": "1.1.0",
    92129219                    "bundled": true,
    9213                     "dev": true,
    9214                     "optional": true
     9220                    "dev": true
    92159221                },
    92169222                "core-util-is": {
     
    93299335                    "version": "2.0.3",
    93309336                    "bundled": true,
    9331                     "dev": true,
    9332                     "optional": true
     9337                    "dev": true
    93339338                },
    93349339                "ini": {
     
    93429347                    "bundled": true,
    93439348                    "dev": true,
    9344                     "optional": true,
    93459349                    "requires": {
    93469350                        "number-is-nan": "^1.0.0"
     
    93579361                    "bundled": true,
    93589362                    "dev": true,
    9359                     "optional": true,
    93609363                    "requires": {
    93619364                        "brace-expansion": "^1.1.7"
     
    93659368                    "version": "0.0.8",
    93669369                    "bundled": true,
    9367                     "dev": true,
    9368                     "optional": true
     9370                    "dev": true
    93699371                },
    93709372                "minipass": {
     
    93729374                    "bundled": true,
    93739375                    "dev": true,
    9374                     "optional": true,
    93759376                    "requires": {
    93769377                        "safe-buffer": "^5.1.2",
     
    93919392                    "bundled": true,
    93929393                    "dev": true,
    9393                     "optional": true,
    93949394                    "requires": {
    93959395                        "minimist": "0.0.8"
     
    94729472                    "version": "1.0.1",
    94739473                    "bundled": true,
    9474                     "dev": true,
    9475                     "optional": true
     9474                    "dev": true
    94769475                },
    94779476                "object-assign": {
     
    94859484                    "bundled": true,
    94869485                    "dev": true,
    9487                     "optional": true,
    94889486                    "requires": {
    94899487                        "wrappy": "1"
     
    95719569                    "version": "5.1.2",
    95729570                    "bundled": true,
    9573                     "dev": true,
    9574                     "optional": true
     9571                    "dev": true
    95759572                },
    95769573                "safer-buffer": {
     
    96089605                    "bundled": true,
    96099606                    "dev": true,
    9610                     "optional": true,
    96119607                    "requires": {
    96129608                        "code-point-at": "^1.0.0",
     
    96289624                    "bundled": true,
    96299625                    "dev": true,
    9630                     "optional": true,
    96319626                    "requires": {
    96329627                        "ansi-regex": "^2.0.0"
     
    96729667                    "version": "1.0.2",
    96739668                    "bundled": true,
    9674                     "dev": true,
    9675                     "optional": true
     9669                    "dev": true
    96769670                },
    96779671                "yallist": {
    96789672                    "version": "3.0.3",
    96799673                    "bundled": true,
    9680                     "dev": true,
    9681                     "optional": true
     9674                    "dev": true
    96829675                }
    96839676            }
     
    98489841            "integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==",
    98499842            "dev": true,
    9850             "optional": true,
    98519843            "requires": {
    98529844                "npm-conf": "^1.1.0"
     
    98719863            "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
    98729864            "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
    9873             "dev": true,
    9874             "optional": true
     9865            "dev": true
    98759866        },
    98769867        "get-value": {
     
    1025710248            "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
    1025810249            "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
    10259             "dev": true,
    10260             "optional": true
     10250            "dev": true
    1026110251        },
    1026210252        "gradient-parser": {
     
    1100910999            "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
    1101011000            "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==",
    11011             "dev": true,
    11012             "optional": true
     11001            "dev": true
    1101311002        },
    1101411003        "has-symbols": {
     
    1102211011            "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==",
    1102311012            "dev": true,
    11024             "optional": true,
    1102511013            "requires": {
    1102611014                "has-symbol-support-x": "^1.4.1"
     
    1214812136            "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz",
    1214912137            "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=",
    12150             "dev": true,
    12151             "optional": true
     12138            "dev": true
    1215212139        },
    1215312140        "is-number": {
     
    1217612163            "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz",
    1217712164            "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=",
    12178             "dev": true,
    12179             "optional": true
     12165            "dev": true
    1218012166        },
    1218112167        "is-path-cwd": {
     
    1225412240            "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
    1225512241            "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==",
    12256             "dev": true,
    12257             "optional": true
     12242            "dev": true
    1225812243        },
    1225912244        "is-stream": {
     
    1248612471            "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==",
    1248712472            "dev": true,
    12488             "optional": true,
    1248912473            "requires": {
    1249012474                "has-to-string-tag-x": "^1.2.0",
     
    1379713781            "resolved": "https://registry.npmjs.org/js-polyfills/-/js-polyfills-0.1.42.tgz",
    1379813782            "integrity": "sha1-XUhJArNh489gH9I60PMLr8yT8Ug="
     13783        },
     13784        "js-reporters": {
     13785            "version": "1.2.1",
     13786            "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-1.2.1.tgz",
     13787            "integrity": "sha1-+IxgjjJKM3OpW8xFrTBeXJecRZs=",
     13788            "dev": true
    1379913789        },
    1380013790        "js-tokens": {
     
    1410214092            }
    1410314093        },
     14094        "just-extend": {
     14095            "version": "4.1.0",
     14096            "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz",
     14097            "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==",
     14098            "dev": true
     14099        },
    1410414100        "kew": {
    1410514101            "version": "0.7.0",
     
    1428114277                },
    1428214278                "minimist": {
    14283                     "version": "1.2.0",
    14284                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    14285                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     14279                    "version": "1.2.5",
     14280                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     14281                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    1428614282                    "dev": true
    1428714283                }
     
    1432614322            "dev": true
    1432714323        },
     14324        "lodash.get": {
     14325            "version": "4.4.2",
     14326            "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
     14327            "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
     14328            "dev": true
     14329        },
    1432814330        "lodash.isequal": {
    1432914331            "version": "4.5.0",
     
    1447714479            "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
    1447814480            "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
    14479             "dev": true,
    14480             "optional": true
     14481            "dev": true
    1448114482        },
    1448214483        "lpad-align": {
     
    1451514516                    "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
    1451614517                    "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
    14517                     "dev": true,
    14518                     "optional": true
     14518                    "dev": true
    1451914519                },
    1452014520                "indent-string": {
     
    1452314523                    "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
    1452414524                    "dev": true,
    14525                     "optional": true,
    1452614525                    "requires": {
    1452714526                        "repeating": "^2.0.0"
     
    1453214531                    "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
    1453314532                    "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
    14534                     "dev": true,
    14535                     "optional": true
     14533                    "dev": true
    1453614534                },
    1453714535                "meow": {
     
    1455514553                },
    1455614554                "minimist": {
    14557                     "version": "1.2.0",
    14558                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    14559                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     14555                    "version": "1.2.5",
     14556                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     14557                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    1456014558                    "dev": true,
    1456114559                    "optional": true
     
    1499614994            "dependencies": {
    1499714995                "kind-of": {
    14998                     "version": "6.0.2",
    14999                     "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
    15000                     "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
     14996                    "version": "6.0.3",
     14997                    "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
     14998                    "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
    1500114999                    "dev": true
    1500215000                }
     
    1504415042            "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
    1504515043            "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
    15046             "dev": true,
    15047             "optional": true
     15044            "dev": true
    1504815045        },
    1504915046        "min-indent": {
     
    1526415261            "dependencies": {
    1526515262                "kind-of": {
    15266                     "version": "6.0.2",
    15267                     "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
    15268                     "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
     15263                    "version": "6.0.3",
     15264                    "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
     15265                    "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
    1526915266                    "dev": true
    1527015267                }
     
    1531815315            "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
    1531915316            "dev": true
     15317        },
     15318        "nise": {
     15319            "version": "4.0.3",
     15320            "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.3.tgz",
     15321            "integrity": "sha512-EGlhjm7/4KvmmE6B/UFsKh7eHykRl9VH+au8dduHLCyWUO/hr7+N+WtTvDUwc9zHuM1IaIJs/0lQ6Ag1jDkQSg==",
     15322            "dev": true,
     15323            "requires": {
     15324                "@sinonjs/commons": "^1.7.0",
     15325                "@sinonjs/fake-timers": "^6.0.0",
     15326                "@sinonjs/text-encoding": "^0.7.1",
     15327                "just-extend": "^4.0.2",
     15328                "path-to-regexp": "^1.7.0"
     15329            },
     15330            "dependencies": {
     15331                "isarray": {
     15332                    "version": "0.0.1",
     15333                    "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
     15334                    "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
     15335                    "dev": true
     15336                },
     15337                "path-to-regexp": {
     15338                    "version": "1.8.0",
     15339                    "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
     15340                    "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
     15341                    "dev": true,
     15342                    "requires": {
     15343                        "isarray": "0.0.1"
     15344                    }
     15345                }
     15346            }
    1532015347        },
    1532115348        "node-fetch": {
     
    1551815545                },
    1551915546                "minimist": {
    15520                     "version": "1.2.0",
    15521                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    15522                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     15547                    "version": "1.2.5",
     15548                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     15549                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    1552315550                    "dev": true
    1552415551                },
     
    1555015577            }
    1555115578        },
     15579        "node-watch": {
     15580            "version": "0.6.1",
     15581            "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.6.1.tgz",
     15582            "integrity": "sha512-gwQiR7weFRV8mAtT0x0kXkZ18dfRLB45xH7q0hCOVQMLfLb2f1ZaSvR57q4/b/Vj6B0RwMNJYbvb69e1yM7qEA==",
     15583            "dev": true
     15584        },
    1555215585        "nopt": {
    1555315586            "version": "3.0.6",
     
    1560015633            "integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==",
    1560115634            "dev": true,
    15602             "optional": true,
    1560315635            "requires": {
    1560415636                "config-chain": "^1.1.11",
     
    1561015642                    "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
    1561115643                    "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
    15612                     "dev": true,
    15613                     "optional": true
     15644                    "dev": true
    1561415645                }
    1561515646            }
     
    1634716378            "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=",
    1634816379            "dev": true,
    16349             "optional": true,
    1635016380            "requires": {
    1635116381                "p-finally": "^1.0.0"
     
    1751917549            "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
    1752017550            "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=",
    17521             "dev": true,
    17522             "optional": true
     17551            "dev": true
    1752317552        },
    1752417553        "proxy-addr": {
     
    1771217741            "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==",
    1771317742            "dev": true
     17743        },
     17744        "qunit": {
     17745            "version": "2.9.3",
     17746            "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.9.3.tgz",
     17747            "integrity": "sha512-RH4VYSaVsNRDthMFFboTJAJ8q4kJM5LvOqWponKUYPEAeOcmc/YFV1QsZ7ikknA3TjqliWFJYEV63vvVXaALmQ==",
     17748            "dev": true,
     17749            "requires": {
     17750                "commander": "2.12.2",
     17751                "js-reporters": "1.2.1",
     17752                "minimatch": "3.0.4",
     17753                "node-watch": "0.6.1",
     17754                "resolve": "1.9.0"
     17755            },
     17756            "dependencies": {
     17757                "commander": {
     17758                    "version": "2.12.2",
     17759                    "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz",
     17760                    "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==",
     17761                    "dev": true
     17762                },
     17763                "resolve": {
     17764                    "version": "1.9.0",
     17765                    "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.9.0.tgz",
     17766                    "integrity": "sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==",
     17767                    "dev": true,
     17768                    "requires": {
     17769                        "path-parse": "^1.0.6"
     17770                    }
     17771                }
     17772            }
    1771417773        },
    1771517774        "raf": {
     
    1900519064            "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=",
    1900619065            "dev": true,
    19007             "optional": true,
    1900819066            "requires": {
    1900919067                "commander": "~2.8.1"
     
    1901519073                    "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
    1901619074                    "dev": true,
    19017                     "optional": true,
    1901819075                    "requires": {
    1901919076                        "graceful-readlink": ">= 1.0.0"
     
    1936319420            }
    1936419421        },
     19422        "sinon": {
     19423            "version": "9.0.1",
     19424            "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz",
     19425            "integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==",
     19426            "dev": true,
     19427            "requires": {
     19428                "@sinonjs/commons": "^1.7.0",
     19429                "@sinonjs/fake-timers": "^6.0.0",
     19430                "@sinonjs/formatio": "^5.0.1",
     19431                "@sinonjs/samsam": "^5.0.3",
     19432                "diff": "^4.0.2",
     19433                "nise": "^4.0.1",
     19434                "supports-color": "^7.1.0"
     19435            },
     19436            "dependencies": {
     19437                "diff": {
     19438                    "version": "4.0.2",
     19439                    "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
     19440                    "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
     19441                    "dev": true
     19442                },
     19443                "has-flag": {
     19444                    "version": "4.0.0",
     19445                    "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
     19446                    "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
     19447                    "dev": true
     19448                },
     19449                "supports-color": {
     19450                    "version": "7.1.0",
     19451                    "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
     19452                    "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
     19453                    "dev": true,
     19454                    "requires": {
     19455                        "has-flag": "^4.0.0"
     19456                    }
     19457                }
     19458            }
     19459        },
     19460        "sinon-test": {
     19461            "version": "3.0.0",
     19462            "resolved": "https://registry.npmjs.org/sinon-test/-/sinon-test-3.0.0.tgz",
     19463            "integrity": "sha512-k2V042JwIS6SC3M8Ih3Uo6+6mlL5FKqvvobxoWQobFkACr61WpyAMKsfqXecLL+DrDD3s9T+eYSZdVQzMH1pkA==",
     19464            "dev": true
     19465        },
    1936519466        "sisteransi": {
    1936619467            "version": "1.0.5",
     
    1955919660            "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
    1956019661            "dev": true,
    19561             "optional": true,
    1956219662            "requires": {
    1956319663                "is-plain-obj": "^1.0.0"
     
    1956919669            "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=",
    1957019670            "dev": true,
    19571             "optional": true,
    1957219671            "requires": {
    1957319672                "sort-keys": "^1.0.0"
     
    2019520294            "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==",
    2019620295            "dev": true,
    20197             "optional": true,
    2019820296            "requires": {
    2019920297                "is-natural-number": "^4.0.1"
     
    2022620324            "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
    2022720325            "dev": true,
    20228             "optional": true,
    2022920326            "requires": {
    2023020327                "escape-string-regexp": "^1.0.2"
     
    2086620963            "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
    2086720964            "dev": true,
    20868             "optional": true,
    2086920965            "requires": {
    2087020966                "bl": "^1.0.0",
     
    2088120977            "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz",
    2088220978            "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=",
    20883             "dev": true,
    20884             "optional": true
     20979            "dev": true
    2088520980        },
    2088620981        "tempfile": {
     
    2088920984            "integrity": "sha1-awRGhWqbERTRhW/8vlCczLCXcmU=",
    2089020985            "dev": true,
    20891             "optional": true,
    2089220986            "requires": {
    2089320987                "temp-dir": "^1.0.0",
     
    2104921143            "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
    2105021144            "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=",
    21051             "dev": true,
    21052             "optional": true
     21145            "dev": true
    2105321146        },
    2105421147        "timers-browserify": {
     
    2113321226            "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
    2113421227            "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==",
    21135             "dev": true,
    21136             "optional": true
     21228            "dev": true
    2113721229        },
    2113821230        "to-fast-properties": {
     
    2126621358            "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
    2126721359            "dev": true,
    21268             "optional": true,
    2126921360            "requires": {
    2127021361                "escape-string-regexp": "^1.0.2"
     
    2139121482            }
    2139221483        },
     21484        "type-detect": {
     21485            "version": "4.0.8",
     21486            "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
     21487            "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
     21488            "dev": true
     21489        },
    2139321490        "type-fest": {
    2139421491            "version": "0.8.1",
     
    2148821585            "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==",
    2148921586            "dev": true,
    21490             "optional": true,
    2149121587            "requires": {
    2149221588                "buffer": "^5.2.1",
     
    2149921595                    "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==",
    2150021596                    "dev": true,
    21501                     "optional": true,
    2150221597                    "requires": {
    2150321598                        "base64-js": "^1.0.2",
     
    2179921894            "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
    2180021895            "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
    21801             "dev": true,
    21802             "optional": true
     21896            "dev": true
    2180321897        },
    2180421898        "use": {
     
    2198622080                },
    2198722081                "minimist": {
    21988                     "version": "1.2.0",
    21989                     "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    21990                     "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     22082                    "version": "1.2.5",
     22083                    "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     22084                    "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
    2199122085                    "dev": true
    2199222086                }
     
    2212822222            "dependencies": {
    2212922223                "acorn": {
    22130                     "version": "6.3.0",
    22131                     "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
    22132                     "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
     22224                    "version": "6.4.1",
     22225                    "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
     22226                    "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
    2213322227                    "dev": true
    2213422228                },
  • trunk/package.json

    r47497 r47512  
    6464        "matchdep": "~2.0.0",
    6565        "node-sass": "~4.13.1",
     66        "qunit": "~2.9.0",
     67        "sinon": "~9.0.0",
     68        "sinon-test": "~3.0.0",
    6669        "source-map-loader": "^0.2.4",
    6770        "uglify-js": "^3.6.0",
  • trunk/tests/qunit/index.html

    r47233 r47512  
    5757
    5858        <!-- QUnit -->
    59         <link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
    60         <script src="vendor/qunit.js"></script>
    61         <script src="vendor/sinon.js"></script>
    62         <script src="vendor/sinon-qunit.js"></script>
    63         <script>QUnit.config.hidepassed = false;</script>
     59        <link rel="stylesheet" href="../../node_modules/qunit/qunit/qunit.css" type="text/css" media="screen" />
     60        <script src="../../node_modules/qunit/qunit/qunit.js"></script>
     61        <script src="../../node_modules/sinon/pkg/sinon.js"></script>
     62        <script src="../../node_modules/sinon-test/dist/sinon-test.js"></script>
     63        <script>
     64            var qTest = QUnit.test, sTest = sinonTest( sinon );
     65
     66            QUnit.config.hidepassed = false;
     67
     68            QUnit.test = function( testName, callback ) {
     69                return qTest( testName, sTest(callback) );
     70            };
     71        </script>
    6472    </head>
    6573    <body>
  • trunk/tests/qunit/wp-admin/js/customize-base.js

    r47122 r47512  
    1 /* global wp, test, ok, equal, module */
     1/* global wp */
    22
    33jQuery( function( $ ) {
     
    55    firstInitialValue, firstValueInstance, valuesInstance, wasCallbackFired, mockValueCallback;
    66
    7     module( 'Customize Base: Class' );
     7    QUnit.module( 'Customize Base: Class' );
    88
    99    FooSuperClass = wp.customize.Class.extend(
    1010        {
    11             initialize: function ( instanceProps ) {
     11            initialize: function( instanceProps ) {
    1212                $.extend( this, instanceProps || {} );
    1313            },
     
    1818        }
    1919    );
    20     test( 'FooSuperClass is a function ', function () {
    21         equal( typeof FooSuperClass, 'function' );
    22     });
    23     test( 'FooSuperClass prototype has protoProp', function () {
    24         equal( FooSuperClass.prototype.protoProp, 'protoPropValue' );
    25     });
    26     test( 'FooSuperClass does not have protoProp', function () {
    27         equal( typeof FooSuperClass.protoProp, 'undefined' );
    28     });
    29     test( 'FooSuperClass has staticProp', function () {
    30         equal( FooSuperClass.staticProp, 'staticPropValue' );
    31     });
    32     test( 'FooSuperClass prototype does not have staticProp', function () {
    33         equal( typeof FooSuperClass.prototype.staticProp, 'undefined' );
     20    QUnit.test( 'FooSuperClass is a function', function( assert ) {
     21        assert.equal( typeof FooSuperClass, 'function' );
     22    });
     23    QUnit.test( 'FooSuperClass prototype has protoProp', function( assert ) {
     24        assert.equal( FooSuperClass.prototype.protoProp, 'protoPropValue' );
     25    });
     26    QUnit.test( 'FooSuperClass does not have protoProp', function( assert ) {
     27        assert.equal( typeof FooSuperClass.protoProp, 'undefined' );
     28    });
     29    QUnit.test( 'FooSuperClass has staticProp', function( assert ) {
     30        assert.equal( FooSuperClass.staticProp, 'staticPropValue' );
     31    });
     32    QUnit.test( 'FooSuperClass prototype does not have staticProp', function( assert ) {
     33        assert.equal( typeof FooSuperClass.prototype.staticProp, 'undefined' );
    3434    });
    3535
    3636    foo = new FooSuperClass( { instanceProp: 'instancePropValue' } );
    37     test( 'FooSuperClass instance foo extended Class', function () {
    38         equal( foo.extended( wp.customize.Class ), true );
    39     });
    40     test( 'foo instance has protoProp', function () {
    41         equal( foo.protoProp, 'protoPropValue' );
    42     });
    43     test( 'foo instance does not have staticProp', function () {
    44         equal( typeof foo.staticProp, 'undefined' );
    45     });
    46     test( 'FooSuperClass instance foo ran initialize() and has supplied instanceProp', function () {
    47         equal( foo.instanceProp, 'instancePropValue' );
     37    QUnit.test( 'FooSuperClass instance foo extended Class', function( assert ) {
     38        assert.equal( foo.extended( wp.customize.Class ), true );
     39    });
     40    QUnit.test( 'foo instance has protoProp', function( assert ) {
     41        assert.equal( foo.protoProp, 'protoPropValue' );
     42    });
     43    QUnit.test( 'foo instance does not have staticProp', function( assert ) {
     44        assert.equal( typeof foo.staticProp, 'undefined' );
     45    });
     46    QUnit.test( 'FooSuperClass instance foo ran initialize() and has supplied instanceProp', function( assert ) {
     47        assert.equal( foo.instanceProp, 'instancePropValue' );
    4848    });
    4949
     
    5151    // @todo Do we test object.instance?
    5252
    53     module( 'Customize Base: Subclass' );
     53    QUnit.module( 'Customize Base: Subclass' );
    5454
    5555    BarSubClass = FooSuperClass.extend(
     
    6565        }
    6666    );
    67     test( 'BarSubClass prototype has subProtoProp', function () {
    68         equal( BarSubClass.prototype.subProtoProp, 'subProtoPropValue' );
    69     });
    70     test( 'BarSubClass prototype has parent FooSuperClass protoProp', function () {
    71         equal( BarSubClass.prototype.protoProp, 'protoPropValue' );
     67    QUnit.test( 'BarSubClass prototype has subProtoProp', function( assert ) {
     68        assert.equal( BarSubClass.prototype.subProtoProp, 'subProtoPropValue' );
     69    });
     70    QUnit.test( 'BarSubClass prototype has parent FooSuperClass protoProp', function( assert ) {
     71        assert.equal( BarSubClass.prototype.protoProp, 'protoPropValue' );
    7272    });
    7373
    7474    bar = new BarSubClass( { instanceProp: 'instancePropValue' } );
    75     test( 'BarSubClass instance bar its initialize() and parent initialize() run', function () {
    76         equal( bar.instanceProp, 'instancePropValue' );
    77         equal( bar.subInstanceProp, 'subInstancePropValue' );
    78     });
    79 
    80     test( 'BarSubClass instance bar extended FooSuperClass', function () {
    81         equal( bar.extended( FooSuperClass ), true );
     75    QUnit.test( 'BarSubClass instance bar its initialize() and parent initialize() run', function( assert ) {
     76        assert.equal( bar.instanceProp, 'instancePropValue' );
     77        assert.equal( bar.subInstanceProp, 'subInstancePropValue' );
     78    });
     79
     80    QUnit.test( 'BarSubClass instance bar extended FooSuperClass', function( assert ) {
     81        assert.equal( bar.extended( FooSuperClass ), true );
    8282    });
    8383
    8484
    8585    // Implements todo: Test Class.constructor() manipulation.
    86     module( 'Customize Base: Constructor Manipulation' );
     86    QUnit.module( 'Customize Base: Constructor Manipulation' );
    8787
    8888    newConstructor = function ( instanceProps ) {
     
    100100    );
    101101
    102     test( 'New constructor added to class' , function () {
    103         equal( ConstructorTestClass.prototype.constructor , newConstructor );
    104     });
    105     test( 'Class with new constructor has protoPropValue' , function () {
    106         equal( ConstructorTestClass.prototype.protoProp , 'protoPropValue' );
     102    QUnit.test( 'New constructor added to class', function( assert ) {
     103        assert.equal( ConstructorTestClass.prototype.constructor , newConstructor );
     104    });
     105    QUnit.test( 'Class with new constructor has protoPropValue', function( assert ) {
     106        assert.equal( ConstructorTestClass.prototype.protoProp , 'protoPropValue' );
    107107    });
    108108
    109109    constructorTest = new ConstructorTestClass( { instanceProp: 'instancePropValue' } );
    110         test( 'ConstructorTestClass instance constructorTest has the new constructor', function () {
    111         equal( constructorTest.constructor, newConstructor );
    112     });
    113 
    114     test( 'ConstructorTestClass instance constructorTest extended Class', function () {
    115         equal( constructorTest.extended( wp.customize.Class ), true );
    116     });
    117 
    118     test( 'ConstructorTestClass instance constructorTest has the added instance property', function () {
    119         equal( constructorTest.instanceProp , 'instancePropValue' );
    120     });
    121 
    122 
    123     module( 'Customize Base: wp.customizer.ensure' );
     110        QUnit.test( 'ConstructorTestClass instance constructorTest has the new constructor', function( assert ) {
     111        assert.equal( constructorTest.constructor, newConstructor );
     112    });
     113
     114    QUnit.test( 'ConstructorTestClass instance constructorTest extended Class', function( assert ) {
     115        assert.equal( constructorTest.extended( wp.customize.Class ), true );
     116    });
     117
     118    QUnit.test( 'ConstructorTestClass instance constructorTest has the added instance property', function( assert ) {
     119        assert.equal( constructorTest.instanceProp , 'instancePropValue' );
     120    });
     121
     122
     123    QUnit.module( 'Customize Base: wp.customizer.ensure' );
    124124
    125125    $mockElement = $( '<div id="mockElement"></div>' );
    126126
    127     test( 'Handles jQuery argument' , function() {
    128         equal( wp.customize.ensure( $mockElement ) , $mockElement );
     127    QUnit.test( 'Handles jQuery argument', function( assert ) {
     128        assert.equal( wp.customize.ensure( $mockElement ) , $mockElement );
    129129    });
    130130
    131131    mockString = '<div class="mockString"></div>';
    132132
    133     test( 'Handles string argument' , function() {
    134         ok( wp.customize.ensure( mockString ) instanceof jQuery );
    135     });
    136 
    137 
    138     module( 'Customize Base: Value Class' );
     133    QUnit.test( 'Handles string argument', function( assert ) {
     134        assert.ok( wp.customize.ensure( mockString ) instanceof jQuery );
     135    });
     136
     137
     138    QUnit.module( 'Customize Base: Value Class' );
    139139
    140140    firstInitialValue = true;
    141141    firstValueInstance = new wp.customize.Value( firstInitialValue );
    142142
    143     test( 'Initialized with the right value' , function() {
    144         equal( firstValueInstance.get() , firstInitialValue );
    145     });
    146 
    147     test( '.set() works' , function() {
     143    QUnit.test( 'Initialized with the right value', function( assert ) {
     144        assert.equal( firstValueInstance.get() , firstInitialValue );
     145    });
     146
     147    QUnit.test( '.set() works', function( assert ) {
    148148        firstValueInstance.set( false );
    149         equal( firstValueInstance.get() , false );
    150     });
    151 
    152     test( '.bind() adds new callback that fires on set()' , function() {
     149        assert.equal( firstValueInstance.get() , false );
     150    });
     151
     152    QUnit.test( '.bind() adds new callback that fires on set()', function( assert ) {
    153153        wasCallbackFired = false;
    154154        mockValueCallback = function() {
     
    157157        firstValueInstance.bind( mockValueCallback );
    158158        firstValueInstance.set( 'newValue' );
    159         ok( wasCallbackFired );
    160     });
    161 
    162     module( 'Customize Base: Values Class' );
     159        assert.ok( wasCallbackFired );
     160    });
     161
     162    QUnit.module( 'Customize Base: Values Class' );
    163163
    164164    valuesInstance = new wp.customize.Values();
    165165
    166     test( 'Correct events are triggered when adding to or removing from Values collection', function() {
     166    QUnit.test( 'Correct events are triggered when adding to or removing from Values collection', function( assert ) {
    167167        var hasFooOnAdd = false,
    168168            hasFooOnRemove = false,
     
    180180        } );
    181181        valuesInstance.add( 'foo', fooValue );
    182         ok( hasFooOnAdd );
    183         equal( valuePassedToAdd.get(), fooValue.get() );
     182        assert.ok( hasFooOnAdd );
     183        assert.equal( valuePassedToAdd.get(), fooValue.get() );
    184184
    185185        // Test events when removing the value.
     
    195195        } );
    196196        valuesInstance.remove( 'foo' );
    197         ok( hasFooOnRemove );
    198         equal( valuePassedToRemove.get(), fooValue.get() );
    199         ok( ! hasFooOnRemoved );
    200         equal( valuePassedToRemoved.get(), fooValue.get() );
     197        assert.ok( hasFooOnRemove );
     198        assert.equal( valuePassedToRemove.get(), fooValue.get() );
     199        assert.ok( ! hasFooOnRemoved );
     200        assert.equal( valuePassedToRemoved.get(), fooValue.get() );
    201201
    202202        // Confirm no events are fired when nonexistent value is removed.
    203203        wasEventFiredOnRemoval = false;
    204204        valuesInstance.remove( 'bar' );
    205         ok( ! wasEventFiredOnRemoval );
    206     });
    207 
    208     module( 'Customize Base: Notification' );
    209     test( 'Notification object exists and has expected properties', function ( assert ) {
     205        assert.ok( ! wasEventFiredOnRemoval );
     206    });
     207
     208    QUnit.module( 'Customize Base: Notification' );
     209    QUnit.test( 'Notification object exists and has expected properties', function ( assert ) {
    210210        var notification = new wp.customize.Notification( 'mycode', {
    211211            'message': 'Hello World',
     
    232232    } );
    233233
    234     module( 'Customize Base: utils.parseQueryString' );
    235     test( 'wp.customize.utils.parseQueryString works', function( assert ) {
     234    QUnit.module( 'Customize Base: utils.parseQueryString' );
     235    QUnit.test( 'wp.customize.utils.parseQueryString works', function( assert ) {
    236236        var queryParams;
    237237        queryParams = wp.customize.utils.parseQueryString( 'a=1&b=2' );
  • trunk/tests/qunit/wp-admin/js/customize-controls-utils.js

    r46586 r47512  
    55        BubbleTester, BubbleTesterTwoValues, bubbleTesterParent, firstBubbleTester, secondBubbleTester;
    66
    7     module( 'Customizer Model Utility functions' );
     7    QUnit.module( 'Customizer Model Utility functions' );
    88
    99    trueMockEvent = {
     
    1717    };
    1818
    19     test( 'isKeydownButNotEnterEvent returns true' , function () {
    20         ok( wp.customize.utils.isKeydownButNotEnterEvent( trueMockEvent ) );
     19    QUnit.test( 'isKeydownButNotEnterEvent returns true', function( assert ) {
     20        assert.ok( wp.customize.utils.isKeydownButNotEnterEvent( trueMockEvent ) );
    2121    });
    2222
    23     test( 'isKeydownButNotEnterEvent returns false' , function () {
    24         equal( wp.customize.utils.isKeydownButNotEnterEvent( falseMockEvent ) , false );
     23    QUnit.test( 'isKeydownButNotEnterEvent returns false', function( assert ) {
     24        assert.equal( wp.customize.utils.isKeydownButNotEnterEvent( falseMockEvent ) , false );
    2525    });
    2626
     
    3737    };
    3838
    39     test( 'areElementListsEqual returns true' , function () {
    40         ok( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.first ) );
     39    QUnit.test( 'areElementListsEqual returns true', function( assert ) {
     40        assert.ok( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.first ) );
    4141    });
    4242
    43     test( 'areElementListsEqual returns false' , function () {
    44         equal( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.second ) , false );
     43    QUnit.test( 'areElementListsEqual returns false', function( assert ) {
     44        assert.equal( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.second ) , false );
    4545    });
    4646
    47     test( 'areElementListsEqual: lists have same values, but in reverse order' , function () {
    48         equal( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.firstInReverseOrder ) , false );
     47    QUnit.test( 'areElementListsEqual: lists have same values, but in reverse order', function( assert ) {
     48        assert.equal( wp.customize.utils.areElementListsEqual( mockElementLists.first , mockElementLists.firstInReverseOrder ) , false );
    4949    });
    5050
    51     test( 'areElementListsEqual: lists have same values, but one is longer' , function () {
    52         equal( wp.customize.utils.areElementListsEqual( mockElementLists.third , mockElementLists.thirdButLonger ) , false );
     51    QUnit.test( 'areElementListsEqual: lists have same values, but one is longer', function( assert ) {
     52        assert.equal( wp.customize.utils.areElementListsEqual( mockElementLists.third , mockElementLists.thirdButLonger ) , false );
    5353    });
    5454
     
    7373    );
    7474
    75     test( 'bubbleChildValueChanges notifies parent of change' , function() {
     75    QUnit.test( 'bubbleChildValueChanges notifies parent of change', function( assert ) {
    7676        firstBubbleTester = new BubbleTester();
    7777        wp.customize.utils.bubbleChildValueChanges( firstBubbleTester , [ 'fooValue' ] );
    7878        firstBubbleTester.fooValue.set( 'new value' );
    79         ok( firstBubbleTester.parent.wasChangeTriggered );
     79        assert.ok( firstBubbleTester.parent.wasChangeTriggered );
    8080    });
    8181
    82     test( 'bubbleChildValueChanges passes a reference to its instance' , function() {
    83         ok( firstBubbleTester.parent.instancePassedInTrigger instanceof BubbleTester );
     82    QUnit.test( 'bubbleChildValueChanges passes a reference to its instance', function( assert ) {
     83        assert.ok( firstBubbleTester.parent.instancePassedInTrigger instanceof BubbleTester );
    8484    });
    8585
     
    9999    secondBubbleTester.barValue.set( 'new value' );
    100100
    101     test( 'bubbleChildValueChanges notifies parent of change when two values are bound' , function() {
    102         ok( secondBubbleTester.parent.wasChangeTriggered );
     101    QUnit.test( 'bubbleChildValueChanges notifies parent of change when two values are bound', function( assert ) {
     102        assert.ok( secondBubbleTester.parent.wasChangeTriggered );
    103103    });
    104104
    105     test( 'bubbleChildValueChanges passes a reference to its instance when two values are bound' , function() {
    106         ok( secondBubbleTester.parent.instancePassedInTrigger instanceof BubbleTesterTwoValues );
     105    QUnit.test( 'bubbleChildValueChanges passes a reference to its instance when two values are bound', function( assert ) {
     106        assert.ok( secondBubbleTester.parent.instancePassedInTrigger instanceof BubbleTesterTwoValues );
    107107    });
    108108});
  • trunk/tests/qunit/wp-admin/js/customize-controls.js

    r47122 r47512  
    1 /* global JSON, wp, test, ok, equal, module */
     1/* global JSON, wp */
    22
    33wp.customize.settingConstructor.abbreviation = wp.customize.Setting.extend({
     
    77});
    88
    9 jQuery( window ).load( function (){
     9jQuery( window ).load( function() {
    1010    'use strict';
    1111
     
    2020        }
    2121        var type = expectedValues.type;
    22         test( 'Model extends proper type', function () {
    23             ok( model.extended( wp.customize[ type ] ) );
     22        QUnit.test( 'Model extends proper type', function( assert ) {
     23            assert.ok( model.extended( wp.customize[ type ] ) );
    2424        } );
    2525
    2626        if ( expectedValues.hasOwnProperty( 'id' ) ) {
    27             test( type + ' instance has the right id', function () {
    28                 equal( model.id, expectedValues.id );
     27            QUnit.test( type + ' instance has the right id', function( assert ) {
     28                assert.equal( model.id, expectedValues.id );
    2929            });
    3030        }
    3131        if ( expectedValues.hasOwnProperty( 'title') ) {
    32             test( type + ' instance has the right title.', function () {
    33                 equal( model.params.title, expectedValues.title );
     32            QUnit.test( type + ' instance has the right title.', function( assert ) {
     33                assert.equal( model.params.title, expectedValues.title );
    3434            });
    3535        }
    3636        if ( expectedValues.hasOwnProperty( 'description' ) ) {
    37             test( type + ' instance has the right description.', function () {
    38                 equal( model.params.description, expectedValues.description );
     37            QUnit.test( type + ' instance has the right description.', function( assert ) {
     38                assert.equal( model.params.description, expectedValues.description );
    3939            });
    4040        }
    4141        if ( expectedValues.hasOwnProperty( 'content' ) ) {
    42             test( type + ' instance has the right content.', function () {
    43                 equal( model.params.content, expectedValues.content );
     42            QUnit.test( type + ' instance has the right content.', function( assert ) {
     43                assert.equal( model.params.content, expectedValues.content );
    4444            });
    4545        }
    4646        if ( expectedValues.hasOwnProperty( 'priority' ) ) {
    47             test( type + ' instance has the right priority.', function () {
    48                 equal( model.priority(), expectedValues.priority );
     47            QUnit.test( type + ' instance has the right priority.', function( assert ) {
     48                assert.equal( model.priority(), expectedValues.priority );
    4949            });
    5050        }
    5151        if ( expectedValues.hasOwnProperty( 'active' ) ) {
    52             test( type + ' instance has the right active state.', function () {
    53                 equal( model.active(), expectedValues.active );
     52            QUnit.test( type + ' instance has the right active state.', function( assert ) {
     53                assert.equal( model.active(), expectedValues.active );
    5454            });
    5555        }
    56         test( type + ' can be deactivated', function () {
     56        QUnit.test( type + ' can be deactivated', function( assert ) {
    5757            model.activate();
    5858            model.deactivate();
    59             equal( model.active(), false );
     59            assert.equal( model.active(), false );
    6060            model.activate();
    61             equal( model.active(), true );
    62             ok(true);
     61            assert.equal( model.active(), true );
     62            assert.ok(true);
    6363        });
    6464
    6565        if ( type === 'Panel' || type === 'Section' ) {
    6666            if ( expectedValues.hasOwnProperty( 'expanded' ) ) {
    67                 test( type + ' instance has the right expanded state.', function () {
    68                     equal( model.expanded(), expectedValues.expanded );
     67                QUnit.test( type + ' instance has the right expanded state.', function( assert ) {
     68                    assert.equal( model.expanded(), expectedValues.expanded );
    6969                } );
    7070            }
    7171
    72             test( type + ' instance is collapsed after calling .collapse()', function () {
     72            QUnit.test( type + ' instance is collapsed after calling .collapse()', function( assert ) {
    7373                model.collapse();
    74                 ok( ! model.expanded() );
     74                assert.ok( ! model.expanded() );
    7575            });
    7676
    77             test( type + ' instance is expanded after calling .expand()', function () {
     77            QUnit.test( type + ' instance is expanded after calling .expand()', function( assert ) {
    7878                model.expand();
    79                 ok( model.expanded() );
     79                assert.ok( model.expanded() );
    8080            });
    8181        }
     
    8383    };
    8484
    85     module( 'Customizer notifications collection' );
    86     test( 'Notifications collection exists', function() {
    87         ok( wp.customize.notifications );
    88         equal( wp.customize.notifications.defaultConstructor, wp.customize.Notification );
    89     } );
    90 
    91     test( 'Notification objects are rendered as part of notifications collection', function() {
     85    QUnit.module( 'Customizer notifications collection' );
     86    QUnit.test( 'Notifications collection exists', function( assert ) {
     87        assert.ok( wp.customize.notifications );
     88        assert.equal( wp.customize.notifications.defaultConstructor, wp.customize.Notification );
     89    } );
     90
     91    QUnit.test( 'Notification objects are rendered as part of notifications collection', function( assert ) {
    9292        var container = jQuery( '#customize-notifications-test' ), items, collection;
    9393
     
    9898        collection.render();
    9999        items = collection.container.find( 'li' );
    100         equal( items.length, 1 );
    101         equal( items.first().data( 'code' ), 'mycode-1' );
     100        assert.equal( items.length, 1 );
     101        assert.equal( items.first().data( 'code' ), 'mycode-1' );
    102102
    103103        collection.add( 'mycode-2', new wp.customize.Notification( 'mycode-2', {
     
    107107        collection.render();
    108108        items = collection.container.find( 'li' );
    109         equal( items.length, 2 );
    110         equal( items.first().data( 'code' ), 'mycode-2' );
    111         equal( items.last().data( 'code' ), 'mycode-1' );
    112 
    113         equal( items.first().find( '.notice-dismiss' ).length, 1 );
    114         equal( items.last().find( '.notice-dismiss' ).length, 0 );
     109        assert.equal( items.length, 2 );
     110        assert.equal( items.first().data( 'code' ), 'mycode-2' );
     111        assert.equal( items.last().data( 'code' ), 'mycode-1' );
     112
     113        assert.equal( items.first().find( '.notice-dismiss' ).length, 1 );
     114        assert.equal( items.last().find( '.notice-dismiss' ).length, 0 );
    115115
    116116        collection.remove( 'mycode-2' );
    117117        collection.render();
    118118        items = collection.container.find( 'li' );
    119         equal( items.length, 1 );
    120         equal( items.first().data( 'code' ), 'mycode-1' );
     119        assert.equal( items.length, 1 );
     120        assert.equal( items.first().data( 'code' ), 'mycode-1' );
    121121
    122122        collection.remove( 'mycode-1' );
    123123        collection.render();
    124         ok( collection.container.is( ':hidden' ), 'Notifications area is hidden.' );
    125     } );
    126 
    127     module( 'Customizer Previewed Device' );
    128     test( 'Previewed device defaults to desktop.', function () {
    129         equal( wp.customize.previewedDevice.get(), 'desktop' );
    130     } );
    131 
    132     module( 'Customizer Setting in Fixture' );
    133     test( 'Setting has fixture value', function () {
    134         equal( wp.customize( 'fixture-setting' )(), 'Lorem Ipsum' );
    135     } );
    136     test( 'Setting has notifications', function () {
     124        assert.ok( collection.container.is( ':hidden' ), 'Notifications area is hidden.' );
     125    } );
     126
     127    QUnit.module( 'Customizer Previewed Device' );
     128    QUnit.test( 'Previewed device defaults to desktop.', function( assert ) {
     129        assert.equal( wp.customize.previewedDevice.get(), 'desktop' );
     130    } );
     131
     132    QUnit.module( 'Customizer Setting in Fixture' );
     133    QUnit.test( 'Setting has fixture value', function( assert ) {
     134        assert.equal( wp.customize( 'fixture-setting' )(), 'Lorem Ipsum' );
     135    } );
     136    QUnit.test( 'Setting has notifications', function( assert ) {
    137137        var setting = wp.customize( 'fixture-setting' );
    138         ok( setting.notifications.extended( wp.customize.Values ) );
    139         equal( wp.customize.Notification, setting.notifications.prototype.constructor.defaultConstructor );
    140     } );
    141     test( 'Setting has findControls method', function() {
     138        assert.ok( setting.notifications.extended( wp.customize.Values ) );
     139        assert.equal( wp.customize.Notification, setting.notifications.prototype.constructor.defaultConstructor );
     140    } );
     141    QUnit.test( 'Setting has findControls method', function( assert ) {
    142142        var controls, setting = wp.customize( 'fixture-setting' );
    143         equal( 'function', typeof setting.findControls );
     143        assert.equal( 'function', typeof setting.findControls );
    144144        controls = setting.findControls();
    145         equal( 1, controls.length );
    146         equal( 'fixture-control', controls[0].id );
    147     } );
    148     test( 'Setting constructor object exists', function( assert ) {
     145        assert.equal( 1, controls.length );
     146        assert.equal( 'fixture-control', controls[0].id );
     147    } );
     148    QUnit.test( 'Setting constructor object exists', function( assert ) {
    149149        assert.ok( _.isObject( wp.customize.settingConstructor ) );
    150150    } );
    151     test( 'Custom setting constructor is used', function( assert ) {
     151    QUnit.test( 'Custom setting constructor is used', function( assert ) {
    152152        var setting = wp.customize( 'fixture-setting-abbr' );
    153153        assert.ok( setting.extended( wp.customize.settingConstructor.abbreviation ) );
     
    156156    } );
    157157
    158     module( 'Customizer Control in Fixture' );
    159     test( 'Control exists', function () {
    160         ok( wp.customize.control.has( 'fixture-control' ) );
    161     } );
    162     test( 'Control has the fixture setting', function () {
     158    QUnit.module( 'Customizer Control in Fixture' );
     159    QUnit.test( 'Control exists', function( assert ) {
     160        assert.ok( wp.customize.control.has( 'fixture-control' ) );
     161    } );
     162    QUnit.test( 'Control has the fixture setting', function( assert ) {
    163163        var control = wp.customize.control( 'fixture-control' );
    164         equal( control.setting(), 'Lorem Ipsum' );
    165         equal( control.setting.id, 'fixture-setting' );
    166     } );
    167     test( 'Control has the section fixture section ID', function () {
     164        assert.equal( control.setting(), 'Lorem Ipsum' );
     165        assert.equal( control.setting.id, 'fixture-setting' );
     166    } );
     167    QUnit.test( 'Control has the section fixture section ID', function( assert ) {
    168168        var control = wp.customize.control( 'fixture-control' );
    169         equal( control.section(), 'fixture-section' );
    170     } );
    171     test( 'Control has notifications', function ( assert ) {
     169        assert.equal( control.section(), 'fixture-section' );
     170    } );
     171    QUnit.test( 'Control has notifications', function ( assert ) {
    172172        var control = wp.customize.control( 'fixture-control' ), settingNotification, controlOnlyNotification, doneEmbedded;
    173173        assert.ok( control.notifications.extended( wp.customize.Values ) );
     
    216216    } );
    217217
    218     module( 'Customizer control without associated settings' );
    219     test( 'Control can be created without settings', function() {
     218    QUnit.module( 'Customizer control without associated settings' );
     219    QUnit.test( 'Control can be created without settings', function( assert ) {
    220220        var control = new wp.customize.Control( 'settingless', {
    221221            params: {
     
    225225        } );
    226226        wp.customize.control.add( control.id, control );
    227         equal( control.deferred.embedded.state(), 'resolved' );
    228         ok( null === control.setting );
    229         ok( jQuery.isEmptyObject( control.settings ) );
     227        assert.equal( control.deferred.embedded.state(), 'resolved' );
     228        assert.ok( null === control.setting );
     229        assert.ok( jQuery.isEmptyObject( control.settings ) );
    230230    } );
    231231
    232232    // Begin sections.
    233     module( 'Customizer Section in Fixture' );
    234     test( 'Fixture section exists', function () {
    235         ok( wp.customize.section.has( 'fixture-section' ) );
    236     } );
    237     test( 'Fixture section has control among controls()', function () {
     233    QUnit.module( 'Customizer Section in Fixture' );
     234    QUnit.test( 'Fixture section exists', function( assert ) {
     235        assert.ok( wp.customize.section.has( 'fixture-section' ) );
     236    } );
     237    QUnit.test( 'Fixture section has control among controls()', function( assert ) {
    238238        var section = wp.customize.section( 'fixture-section' );
    239         ok( -1 !== _.pluck( section.controls(), 'id' ).indexOf( 'fixture-control' ) );
    240     } );
    241     test( 'Fixture section has has expected panel', function () {
     239        assert.ok( -1 !== _.pluck( section.controls(), 'id' ).indexOf( 'fixture-control' ) );
     240    } );
     241    QUnit.test( 'Fixture section has has expected panel', function( assert ) {
    242242        var section = wp.customize.section( 'fixture-section' );
    243         equal( section.panel(), 'fixture-panel' );
    244     } );
    245 
    246     module( 'Customizer Default Section with Template in Fixture' );
    247     test( 'Fixture section exists', function () {
    248         ok( wp.customize.section.has( 'fixture-section-default-templated' ) );
    249     } );
    250     test( 'Fixture section has expected content', function () {
     243        assert.equal( section.panel(), 'fixture-panel' );
     244    } );
     245
     246    QUnit.module( 'Customizer Default Section with Template in Fixture' );
     247    QUnit.test( 'Fixture section exists', function( assert ) {
     248        assert.ok( wp.customize.section.has( 'fixture-section-default-templated' ) );
     249    } );
     250    QUnit.test( 'Fixture section has expected content', function( assert ) {
    251251        var id = 'fixture-section-default-templated', section;
    252252        section = wp.customize.section( id );
    253         ok( ! section.params.content );
    254         ok( !! section.container );
    255         ok( !! section.headContainer );
    256         ok( !! section.contentContainer );
    257         ok( section.container.has( section.headContainer ) );
    258         ok( section.container.has( section.contentContainer ) );
    259         ok( section.headContainer.is( '.control-section.control-section-default' ) );
    260         ok( 1 === section.headContainer.find( '> .accordion-section-title' ).length );
    261         ok( section.contentContainer.is( '.accordion-section-content' ) );
    262         equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
    263     } );
    264 
    265     module( 'Customizer Custom Type (titleless) Section with Template in Fixture' );
    266     test( 'Fixture section exists', function () {
    267         ok( wp.customize.section.has( 'fixture-section-titleless-templated' ) );
    268     } );
    269     test( 'Fixture section has expected content', function () {
     253        assert.ok( ! section.params.content );
     254        assert.ok( !! section.container );
     255        assert.ok( !! section.headContainer );
     256        assert.ok( !! section.contentContainer );
     257        assert.ok( section.container.has( section.headContainer ) );
     258        assert.ok( section.container.has( section.contentContainer ) );
     259        assert.ok( section.headContainer.is( '.control-section.control-section-default' ) );
     260        assert.ok( 1 === section.headContainer.find( '> .accordion-section-title' ).length );
     261        assert.ok( section.contentContainer.is( '.accordion-section-content' ) );
     262        assert.equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
     263    } );
     264
     265    QUnit.module( 'Customizer Custom Type (titleless) Section with Template in Fixture' );
     266    QUnit.test( 'Fixture section exists', function( assert ) {
     267        assert.ok( wp.customize.section.has( 'fixture-section-titleless-templated' ) );
     268    } );
     269    QUnit.test( 'Fixture section has expected content', function( assert ) {
    270270        var id = 'fixture-section-titleless-templated', section;
    271271        section = wp.customize.section( id );
    272         ok( ! section.params.content );
    273         ok( !! section.container );
    274         ok( !! section.headContainer );
    275         ok( !! section.contentContainer );
    276         ok( section.container.has( section.headContainer ) );
    277         ok( section.container.has( section.contentContainer ) );
    278         ok( section.container.is( '.control-section.control-section-titleless' ) );
    279         ok( 0 === section.headContainer.find( '> .accordion-section-title' ).length );
    280         ok( section.contentContainer.is( '.accordion-section-content' ) );
    281         equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
    282     } );
    283     module( 'Customizer Custom Type Section Lacking Specific Template' );
    284     test( 'Fixture section has expected content', function () {
     272        assert.ok( ! section.params.content );
     273        assert.ok( !! section.container );
     274        assert.ok( !! section.headContainer );
     275        assert.ok( !! section.contentContainer );
     276        assert.ok( section.container.has( section.headContainer ) );
     277        assert.ok( section.container.has( section.contentContainer ) );
     278        assert.ok( section.container.is( '.control-section.control-section-titleless' ) );
     279        assert.ok( 0 === section.headContainer.find( '> .accordion-section-title' ).length );
     280        assert.ok( section.contentContainer.is( '.accordion-section-content' ) );
     281        assert.equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
     282    } );
     283    QUnit.module( 'Customizer Custom Type Section Lacking Specific Template' );
     284    QUnit.test( 'Fixture section has expected content', function( assert ) {
    285285        var id = 'fixture-section-reusing-default-template', section;
    286286        section = wp.customize.section( id );
    287         ok( ! section.params.content );
    288         ok( !! section.container );
    289         ok( !! section.headContainer );
    290         ok( !! section.contentContainer );
    291         ok( section.container.has( section.headContainer ) );
    292         ok( section.container.has( section.contentContainer ) );
    293         ok( section.headContainer.is( '.control-section.control-section-' + section.params.type ) );
    294         ok( 1 === section.headContainer.find( '> .accordion-section-title' ).length );
    295         ok( section.contentContainer.is( '.accordion-section-content' ) );
    296         equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
    297     } );
    298     module( 'Customizer Section lacking any params' );
    299     test( 'Fixture section has default params supplied', function () {
     287        assert.ok( ! section.params.content );
     288        assert.ok( !! section.container );
     289        assert.ok( !! section.headContainer );
     290        assert.ok( !! section.contentContainer );
     291        assert.ok( section.container.has( section.headContainer ) );
     292        assert.ok( section.container.has( section.contentContainer ) );
     293        assert.ok( section.headContainer.is( '.control-section.control-section-' + section.params.type ) );
     294        assert.ok( 1 === section.headContainer.find( '> .accordion-section-title' ).length );
     295        assert.ok( section.contentContainer.is( '.accordion-section-content' ) );
     296        assert.equal( section.headContainer.attr( 'aria-owns' ), section.contentContainer.attr( 'id' ) );
     297    } );
     298    QUnit.module( 'Customizer Section lacking any params' );
     299    QUnit.test( 'Fixture section has default params supplied', function( assert ) {
    300300        var id = 'fixture-section-without-params', section, defaultParams;
    301301        section = wp.customize.section( id );
     
    311311        };
    312312        jQuery.each( defaultParams, function ( key, value ) {
    313             ok( 'undefined' !== typeof section.params[ key ] );
    314             equal( value, section.params[ key ] );
    315         } );
    316         ok( _.isNumber( section.params.instanceNumber ) );
     313            assert.ok( 'undefined' !== typeof section.params[ key ] );
     314            assert.equal( value, section.params[ key ] );
     315        } );
     316        assert.ok( _.isNumber( section.params.instanceNumber ) );
    317317    } );
    318318
    319319
    320320    // Begin panels.
    321     module( 'Customizer Panel in Fixture' );
    322     test( 'Fixture panel exists', function () {
    323         ok( wp.customize.panel.has( 'fixture-panel' ) );
    324     } );
    325     test( 'Fixture panel has content', function () {
     321    QUnit.module( 'Customizer Panel in Fixture' );
     322    QUnit.test( 'Fixture panel exists', function( assert ) {
     323        assert.ok( wp.customize.panel.has( 'fixture-panel' ) );
     324    } );
     325    QUnit.test( 'Fixture panel has content', function( assert ) {
    326326        var panel = wp.customize.panel( 'fixture-panel' );
    327         ok( !! panel.params.content );
    328         ok( !! panel.container );
    329         ok( !! panel.headContainer );
    330         ok( !! panel.contentContainer );
    331         ok( panel.container.has( panel.headContainer ) );
    332         ok( panel.container.has( panel.contentContainer ) );
    333     } );
    334     test( 'Fixture panel has section among its sections()', function () {
     327        assert.ok( !! panel.params.content );
     328        assert.ok( !! panel.container );
     329        assert.ok( !! panel.headContainer );
     330        assert.ok( !! panel.contentContainer );
     331        assert.ok( panel.container.has( panel.headContainer ) );
     332        assert.ok( panel.container.has( panel.contentContainer ) );
     333    } );
     334    QUnit.test( 'Fixture panel has section among its sections()', function( assert ) {
    335335        var panel = wp.customize.panel( 'fixture-panel' );
    336         ok( -1 !== _.pluck( panel.sections(), 'id' ).indexOf( 'fixture-section' ) );
    337     } );
    338     test( 'Panel is not expanded by default', function () {
     336        assert.ok( -1 !== _.pluck( panel.sections(), 'id' ).indexOf( 'fixture-section' ) );
     337    } );
     338    QUnit.test( 'Panel is not expanded by default', function( assert ) {
    339339        var panel = wp.customize.panel( 'fixture-panel' );
    340         ok( ! panel.expanded() );
    341     } );
    342     test( 'Panel is not expanded by default', function () {
     340        assert.ok( ! panel.expanded() );
     341    } );
     342    QUnit.test( 'Panel is not expanded by default', function( assert ) {
    343343        var panel = wp.customize.panel( 'fixture-panel' );
    344         ok( ! panel.expanded() );
    345     } );
    346     test( 'Focusing on a control will expand the panel and section', function () {
     344        assert.ok( ! panel.expanded() );
     345    } );
     346    QUnit.test( 'Focusing on a control will expand the panel and section', function( assert ) {
    347347        var panel, section, control;
    348348        panel = wp.customize.panel( 'fixture-panel' );
    349349        section = wp.customize.section( 'fixture-section' );
    350350        control = wp.customize.control( 'fixture-control' );
    351         ok( ! panel.expanded() );
    352         ok( ! section.expanded() );
     351        assert.ok( ! panel.expanded() );
     352        assert.ok( ! section.expanded() );
    353353        control.focus();
    354         ok( section.expanded() );
    355         ok( panel.expanded() );
    356     } );
    357 
    358     module( 'Customizer Default Panel with Template in Fixture' );
    359     test( 'Fixture section exists', function () {
    360         ok( wp.customize.panel.has( 'fixture-panel-default-templated' ) );
    361     } );
    362     test( 'Fixture panel has expected content', function () {
     354        assert.ok( section.expanded() );
     355        assert.ok( panel.expanded() );
     356    } );
     357
     358    QUnit.module( 'Customizer Default Panel with Template in Fixture' );
     359    QUnit.test( 'Fixture section exists', function( assert ) {
     360        assert.ok( wp.customize.panel.has( 'fixture-panel-default-templated' ) );
     361    } );
     362    QUnit.test( 'Fixture panel has expected content', function( assert ) {
    363363        var id = 'fixture-panel-default-templated', panel;
    364364        panel = wp.customize.panel( id );
    365         ok( ! panel.params.content );
    366         ok( !! panel.container );
    367         ok( !! panel.headContainer );
    368         ok( !! panel.contentContainer );
    369         ok( panel.container.has( panel.headContainer ) );
    370         ok( panel.container.has( panel.contentContainer ) );
    371         ok( panel.headContainer.is( '.control-panel.control-panel-default' ) );
    372         ok( 1 === panel.headContainer.find( '> .accordion-section-title' ).length );
    373         ok( panel.contentContainer.is( '.control-panel-content' ) );
    374         equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
    375     } );
    376 
    377     module( 'Customizer Custom Type Panel (titleless) with Template in Fixture' );
    378     test( 'Fixture panel exists', function () {
    379         ok( wp.customize.panel.has( 'fixture-panel-titleless-templated' ) );
    380     } );
    381     test( 'Fixture panel has expected content', function () {
     365        assert.ok( ! panel.params.content );
     366        assert.ok( !! panel.container );
     367        assert.ok( !! panel.headContainer );
     368        assert.ok( !! panel.contentContainer );
     369        assert.ok( panel.container.has( panel.headContainer ) );
     370        assert.ok( panel.container.has( panel.contentContainer ) );
     371        assert.ok( panel.headContainer.is( '.control-panel.control-panel-default' ) );
     372        assert.ok( 1 === panel.headContainer.find( '> .accordion-section-title' ).length );
     373        assert.ok( panel.contentContainer.is( '.control-panel-content' ) );
     374        assert.equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
     375    } );
     376
     377    QUnit.module( 'Customizer Custom Type Panel (titleless) with Template in Fixture' );
     378    QUnit.test( 'Fixture panel exists', function( assert ) {
     379        assert.ok( wp.customize.panel.has( 'fixture-panel-titleless-templated' ) );
     380    } );
     381    QUnit.test( 'Fixture panel has expected content', function( assert ) {
    382382        var id = 'fixture-panel-titleless-templated', panel;
    383383        panel = wp.customize.panel( id );
    384         ok( ! panel.params.content );
    385         ok( !! panel.container );
    386         ok( !! panel.headContainer );
    387         ok( !! panel.contentContainer );
    388         ok( panel.container.has( panel.headContainer ) );
    389         ok( panel.container.has( panel.contentContainer ) );
    390         ok( panel.headContainer.is( '.control-panel.control-panel-titleless' ) );
    391         ok( 0 === panel.headContainer.find( '> .accordion-section-title' ).length );
    392         ok( panel.contentContainer.is( '.control-panel-content' ) );
    393         equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
    394     } );
    395 
    396     module( 'Customizer Custom Type Panel Lacking Specific Template' );
    397     test( 'Fixture panel has expected content', function () {
     384        assert.ok( ! panel.params.content );
     385        assert.ok( !! panel.container );
     386        assert.ok( !! panel.headContainer );
     387        assert.ok( !! panel.contentContainer );
     388        assert.ok( panel.container.has( panel.headContainer ) );
     389        assert.ok( panel.container.has( panel.contentContainer ) );
     390        assert.ok( panel.headContainer.is( '.control-panel.control-panel-titleless' ) );
     391        assert.ok( 0 === panel.headContainer.find( '> .accordion-section-title' ).length );
     392        assert.ok( panel.contentContainer.is( '.control-panel-content' ) );
     393        assert.equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
     394    } );
     395
     396    QUnit.module( 'Customizer Custom Type Panel Lacking Specific Template' );
     397    QUnit.test( 'Fixture panel has expected content', function( assert ) {
    398398        var id = 'fixture-panel-reusing-default-template', panel;
    399399        panel = wp.customize.panel( id );
    400         ok( ! panel.params.content );
    401         ok( !! panel.container );
    402         ok( !! panel.headContainer );
    403         ok( !! panel.contentContainer );
    404         ok( panel.container.has( panel.headContainer ) );
    405         ok( panel.container.has( panel.contentContainer ) );
    406         ok( panel.headContainer.is( '.control-panel.control-panel-' + panel.params.type ) );
    407         ok( 1 === panel.headContainer.find( '> .accordion-section-title' ).length );
    408         ok( panel.contentContainer.is( '.control-panel-content' ) );
    409         equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
    410     } );
    411     module( 'Customizer Panel lacking any params' );
    412     test( 'Fixture panel has default params supplied', function () {
     400        assert.ok( ! panel.params.content );
     401        assert.ok( !! panel.container );
     402        assert.ok( !! panel.headContainer );
     403        assert.ok( !! panel.contentContainer );
     404        assert.ok( panel.container.has( panel.headContainer ) );
     405        assert.ok( panel.container.has( panel.contentContainer ) );
     406        assert.ok( panel.headContainer.is( '.control-panel.control-panel-' + panel.params.type ) );
     407        assert.ok( 1 === panel.headContainer.find( '> .accordion-section-title' ).length );
     408        assert.ok( panel.contentContainer.is( '.control-panel-content' ) );
     409        assert.equal( panel.headContainer.attr( 'aria-owns' ), panel.contentContainer.attr( 'id' ) );
     410    } );
     411    QUnit.module( 'Customizer Panel lacking any params' );
     412    QUnit.test( 'Fixture panel has default params supplied', function( assert ) {
    413413        var id = 'fixture-panel-without-params', panel, defaultParams;
    414414        panel = wp.customize.panel( id );
     
    422422        };
    423423        jQuery.each( defaultParams, function ( key, value ) {
    424             ok( 'undefined' !== typeof panel.params[ key ] );
    425             equal( value, panel.params[ key ] );
    426         } );
    427         ok( _.isNumber( panel.params.instanceNumber ) );
    428     } );
    429 
    430     module( 'Dynamically-created Customizer Setting Model' );
     424            assert.ok( 'undefined' !== typeof panel.params[ key ] );
     425            assert.equal( value, panel.params[ key ] );
     426        } );
     427        assert.ok( _.isNumber( panel.params.instanceNumber ) );
     428    } );
     429
     430    QUnit.module( 'Dynamically-created Customizer Setting Model' );
    431431    settingId = 'new_blogname';
    432432    settingValue = 'Hello World';
    433433
    434     test( 'Create a new setting', function () {
     434    QUnit.test( 'Create a new setting', function( assert ) {
    435435        mockSetting = wp.customize.create(
    436436            settingId,
     
    442442            }
    443443        );
    444         equal( mockSetting(), settingValue );
    445         equal( mockSetting.id, settingId );
    446     } );
    447 
    448     module( 'Dynamically-created Customizer Section Model' );
     444        assert.equal( mockSetting(), settingValue );
     445        assert.equal( mockSetting.id, settingId );
     446    } );
     447
     448    QUnit.module( 'Dynamically-created Customizer Section Model' );
    449449
    450450    sectionId = 'mock_title_tagline';
     
    468468    testCustomizerModel( mockSection, sectionExpectedValues );
    469469
    470     test( 'Section has been embedded', function () {
    471         equal( mockSection.deferred.embedded.state(), 'resolved' );
     470    QUnit.test( 'Section has been embedded', function( assert ) {
     471        assert.equal( mockSection.deferred.embedded.state(), 'resolved' );
    472472    } );
    473473
    474474    wp.customize.section.add( sectionId, mockSection );
    475475
    476     test( 'Section instance added to the wp.customize.section object', function () {
    477         ok( wp.customize.section.has( sectionId ) );
     476    QUnit.test( 'Section instance added to the wp.customize.section object', function( assert ) {
     477        assert.ok( wp.customize.section.has( sectionId ) );
    478478    });
    479479
    480480    sectionInstance = wp.customize.section( sectionId );
    481481
    482     test( 'Section instance has right content when accessed from wp.customize.section()', function () {
    483         equal( sectionInstance.params.content, sectionContent );
    484     });
    485 
    486     test( 'Section instance has no children yet', function () {
    487         equal( sectionInstance.controls().length, 0 );
    488     });
    489 
    490     module( 'Dynamically-created Customizer Control Model' );
     482    QUnit.test( 'Section instance has right content when accessed from wp.customize.section()', function( assert ) {
     483        assert.equal( sectionInstance.params.content, sectionContent );
     484    });
     485
     486    QUnit.test( 'Section instance has no children yet', function( assert ) {
     487        assert.equal( sectionInstance.controls().length, 0 );
     488    });
     489
     490    QUnit.module( 'Dynamically-created Customizer Control Model' );
    491491
    492492    controlId = 'new_blogname';
     
    521521    testCustomizerModel( mockControl, controlExpectedValues );
    522522
    523     test( 'Control instance does not yet belong to a section.', function () {
    524         equal( mockControl.section(), undefined );
    525     });
    526     test( 'Control has not been embedded yet', function () {
    527         equal( mockControl.deferred.embedded.state(), 'pending' );
    528     } );
    529 
    530     test( 'Control instance has the right selector.', function () {
    531         equal( mockControl.selector, '#customize-control-new_blogname' );
     523    QUnit.test( 'Control instance does not yet belong to a section.', function( assert ) {
     524        assert.equal( mockControl.section(), undefined );
     525    });
     526    QUnit.test( 'Control has not been embedded yet', function( assert ) {
     527        assert.equal( mockControl.deferred.embedded.state(), 'pending' );
     528    } );
     529
     530    QUnit.test( 'Control instance has the right selector.', function( assert ) {
     531        assert.equal( mockControl.selector, '#customize-control-new_blogname' );
    532532    });
    533533
    534534    wp.customize.control.add( controlId, mockControl );
    535535
    536     test( 'Control instance was added to the control class.', function () {
    537         ok( wp.customize.control.has( controlId ) );
     536    QUnit.test( 'Control instance was added to the control class.', function( assert ) {
     537        assert.ok( wp.customize.control.has( controlId ) );
    538538    });
    539539
    540540    mockControlInstance = wp.customize.control( controlId );
    541541
    542     test( 'Control instance has the right id when accessed from api.control().', function () {
    543         equal( mockControlInstance.id, controlId );
    544     });
    545 
    546     test( 'Control section can be set as expected', function () {
     542    QUnit.test( 'Control instance has the right id when accessed from api.control().', function( assert ) {
     543        assert.equal( mockControlInstance.id, controlId );
     544    });
     545
     546    QUnit.test( 'Control section can be set as expected', function( assert ) {
    547547        mockControl.section( mockSection.id );
    548         equal( mockControl.section(), mockSection.id );
    549     });
    550     test( 'Associating a control with a section allows it to be embedded', function () {
    551         equal( mockControl.deferred.embedded.state(), 'resolved' );
    552     });
    553 
    554     test( 'Control is now available on section.controls()', function () {
    555         equal( sectionInstance.controls().length, 1 );
    556         equal( sectionInstance.controls()[0], mockControl );
    557     });
    558 
    559     module( 'Dynamically-created Customizer Panel Model' );
     548        assert.equal( mockControl.section(), mockSection.id );
     549    });
     550    QUnit.test( 'Associating a control with a section allows it to be embedded', function( assert ) {
     551        assert.equal( mockControl.deferred.embedded.state(), 'resolved' );
     552    });
     553
     554    QUnit.test( 'Control is now available on section.controls()', function( assert ) {
     555        assert.equal( sectionInstance.controls().length, 1 );
     556        assert.equal( sectionInstance.controls()[0], mockControl );
     557    });
     558
     559    QUnit.module( 'Dynamically-created Customizer Panel Model' );
    560560
    561561    panelId = 'mockPanelId';
     
    585585    testCustomizerModel( mockPanel, panelExpectedValues );
    586586
    587     test( 'Panel instance is not contextuallyActive', function () {
    588         equal( mockPanel.isContextuallyActive(), false );
    589     });
    590 
    591     module( 'Test wp.customize.findControlsForSettings' );
    592     test( 'findControlsForSettings(blogname)', function() {
     587    QUnit.test( 'Panel instance is not contextuallyActive', function( assert ) {
     588        assert.equal( mockPanel.isContextuallyActive(), false );
     589    });
     590
     591    QUnit.module( 'Test wp.customize.findControlsForSettings' );
     592    QUnit.test( 'findControlsForSettings(blogname)', function( assert ) {
    593593        var controlsForSettings, settingId = 'fixture-setting', controlId = 'fixture-control';
    594         ok( wp.customize.control.has( controlId ) );
    595         ok( wp.customize.has( settingId ) );
     594        assert.ok( wp.customize.control.has( controlId ) );
     595        assert.ok( wp.customize.has( settingId ) );
    596596        controlsForSettings = wp.customize.findControlsForSettings( [ settingId ] );
    597         ok( _.isObject( controlsForSettings ), 'Response is object' );
    598         ok( _.isArray( controlsForSettings['fixture-setting'] ), 'Response has a fixture-setting array' );
    599         equal( 1, controlsForSettings['fixture-setting'].length );
    600         equal( wp.customize.control( controlId ), controlsForSettings['fixture-setting'][0] );
    601     } );
    602 
    603     module( 'Customize Controls wp.customize.dirtyValues' );
    604     test( 'dirtyValues() returns expected values', function() {
     597        assert.ok( _.isObject( controlsForSettings ), 'Response is object' );
     598        assert.ok( _.isArray( controlsForSettings['fixture-setting'] ), 'Response has a fixture-setting array' );
     599        assert.equal( 1, controlsForSettings['fixture-setting'].length );
     600        assert.equal( wp.customize.control( controlId ), controlsForSettings['fixture-setting'][0] );
     601    } );
     602
     603    QUnit.module( 'Customize Controls wp.customize.dirtyValues' );
     604    QUnit.test( 'dirtyValues() returns expected values', function( assert ) {
    605605        wp.customize.state( 'changesetStatus' ).set( 'auto-draft' );
    606606        wp.customize.each( function( setting ) {
    607607            setting._dirty = false;
    608608        } );
    609         ok( _.isEmpty( wp.customize.dirtyValues() ) );
    610         ok( _.isEmpty( wp.customize.dirtyValues( { unsaved: false } ) ) );
     609        assert.ok( _.isEmpty( wp.customize.dirtyValues() ) );
     610        assert.ok( _.isEmpty( wp.customize.dirtyValues( { unsaved: false } ) ) );
    611611
    612612        wp.customize( 'fixture-setting' )._dirty = true;
    613         ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
    614         ok( _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
     613        assert.ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
     614        assert.ok( _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
    615615
    616616        wp.customize( 'fixture-setting' ).set( 'Modified' );
    617         ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
    618         ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
    619         equal( 'Modified', wp.customize.dirtyValues()['fixture-setting'] );
     617        assert.ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
     618        assert.ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
     619        assert.equal( 'Modified', wp.customize.dirtyValues()['fixture-setting'] );
    620620
    621621        // When the changeset does not exist, all dirty settings are necessarily unsaved.
    622622        wp.customize.state( 'changesetStatus' ).set( '' );
    623623        wp.customize( 'fixture-setting' )._dirty = true;
    624         ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
    625         ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
    626     } );
    627 
    628     module( 'Customize Controls: wp.customize.requestChangesetUpdate()' );
    629     test( 'requestChangesetUpdate makes request and returns promise', function( assert ) {
     624        assert.ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
     625        assert.ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
     626    } );
     627
     628    QUnit.module( 'Customize Controls: wp.customize.requestChangesetUpdate()' );
     629    QUnit.test( 'requestChangesetUpdate makes request and returns promise', function( assert ) {
    630630        var request, originalBeforeSetup = jQuery.ajaxSettings.beforeSend;
    631631
     
    678678    } );
    679679
    680     module( 'Customize Utils: wp.customize.utils.getRemainingTime()' );
    681     test( 'utils.getRemainingTime calculates time correctly', function( assert ) {
     680    QUnit.module( 'Customize Utils: wp.customize.utils.getRemainingTime()' );
     681    QUnit.test( 'utils.getRemainingTime calculates time correctly', function( assert ) {
    682682        var datetime = '2599-08-06 12:12:13', timeRemaining, timeRemainingWithDateInstance, timeRemaingingWithTimestamp;
    683683
     
    693693    });
    694694
    695     module( 'Customize Utils: wp.customize.utils.getCurrentTimestamp()' );
    696     test( 'utils.getCurrentTimestamp returns timestamp', function( assert ) {
     695    QUnit.module( 'Customize Utils: wp.customize.utils.getCurrentTimestamp()' );
     696    QUnit.test( 'utils.getCurrentTimestamp returns timestamp', function( assert ) {
    697697        var currentTimeStamp;
    698698        currentTimeStamp = wp.customize.utils.getCurrentTimestamp();
     
    700700    });
    701701
    702     module( 'Customize Controls: wp.customize.DateTimeControl' );
    703     test( 'Test DateTimeControl creation and its methods', function( assert ) {
     702    QUnit.module( 'Customize Controls: wp.customize.DateTimeControl' );
     703    QUnit.test( 'Test DateTimeControl creation and its methods', function( assert ) {
    704704        var control, controlId = 'date_time', section, sectionId = 'fixture-section',
    705705            datetime = '2599-08-06 18:12:13', dateTimeArray, dateTimeArrayInampm, timeString,
     
    865865    });
    866866
    867     module( 'Customize Sections: wp.customize.OuterSection' );
    868     test( 'Test OuterSection', function( assert ) {
     867    QUnit.module( 'Customize Sections: wp.customize.OuterSection' );
     868    QUnit.test( 'Test OuterSection', function( assert ) {
    869869        var section, sectionId = 'test_outer_section', body = jQuery( 'body' ),
    870870            defaultSection, defaultSectionId = 'fixture-section';
     
    900900    });
    901901
    902     module( 'Customize Controls: PreviewLinkControl' );
    903     test( 'Test PreviewLinkControl creation and its methods', function( assert ) {
     902    QUnit.module( 'Customize Controls: PreviewLinkControl' );
     903    QUnit.test( 'Test PreviewLinkControl creation and its methods', function( assert ) {
    904904        var section, sectionId = 'publish_settings', newLink;
    905905
  • trunk/tests/qunit/wp-admin/js/customize-header.js

    r46586 r47512  
    22
    33jQuery( function() {
    4     module('Custom Header: ChoiceList', {
    5         setup: function() {
     4    QUnit.module('Custom Header: ChoiceList', {
     5        beforeEach: function() {
    66            wp.customize.HeaderTool.currentHeader = new wp.customize.HeaderTool.ImageModel();
    77            this.apiStub = sinon.stub(wp.customize, 'get').returns('foo');
    88            this.choiceList = new wp.customize.HeaderTool.ChoiceList();
    99        },
    10         teardown: function() {
     10        afterEach: function() {
    1111            this.apiStub.restore();
    1212        }
    1313    });
    1414
    15     test('should parse _wpCustomizeHeader.uploads into itself', function() {
    16         equal(this.choiceList.length, 4);
     15    QUnit.test('should parse _wpCustomizeHeader.uploads into itself', function( assert ) {
     16        assert.equal(this.choiceList.length, 4);
    1717    });
    1818
    19     test('should sort by newest first', function() {
    20         equal(this.choiceList.at(2).get('header').attachment_id, 1);
    21         equal(this.choiceList.first().get('header').attachment_id, 3);
     19    QUnit.test('should sort by newest first', function( assert ) {
     20        assert.equal(this.choiceList.at(2).get('header').attachment_id, 1);
     21        assert.equal(this.choiceList.first().get('header').attachment_id, 3);
    2222    });
    2323
    24     module('Custom Header: DefaultsList', {
    25         setup: function() {
     24    QUnit.module('Custom Header: DefaultsList', {
     25        beforeEach: function() {
    2626            wp.customize.HeaderTool.currentHeader = new wp.customize.HeaderTool.ImageModel();
    2727            this.apiStub = sinon.stub(wp.customize, 'get').returns('foo');
    2828            this.choiceList = new wp.customize.HeaderTool.DefaultsList();
    2929        },
    30         teardown: function() {
     30        afterEach: function() {
    3131            this.apiStub.restore();
    3232        }
    3333    });
    3434
    35     test('it should parse _wpCustomizeHeader.defaults into itself', function() {
    36         equal(this.choiceList.length, 4);
     35    QUnit.test('it should parse _wpCustomizeHeader.defaults into itself', function( assert ) {
     36        assert.equal(this.choiceList.length, 4);
    3737    });
    3838
    39     test('it parses the default image names', function() {
    40         equal(this.choiceList.first().get('header').defaultName, 'circle');
    41         equal(this.choiceList.at(2).get('header').defaultName, 'star');
     39    QUnit.test('it parses the default image names', function( assert ) {
     40        assert.equal(this.choiceList.first().get('header').defaultName, 'circle');
     41        assert.equal(this.choiceList.at(2).get('header').defaultName, 'star');
    4242    });
    4343
    44     module('Custom Header: HeaderImage shouldBeCropped()', {
    45         setup: function() {
     44    QUnit.module('Custom Header: HeaderImage shouldBeCropped()', {
     45        beforeEach: function() {
    4646            wp.customize.HeaderTool.currentHeader = new wp.customize.HeaderTool.ImageModel();
    4747            this.model = new wp.customize.HeaderTool.ImageModel();
     
    5353    });
    5454
    55     test('should not be cropped when the theme does not support flex width or height and the image has the same dimensions of the theme image', function() {
     55    QUnit.test('should not be cropped when the theme does not support flex width or height and the image has the same dimensions of the theme image', function( assert ) {
    5656        this.model.set({
    5757            themeFlexWidth: false,
     
    6161        });
    6262
    63         equal(this.model.shouldBeCropped(), false);
     63        assert.equal(this.model.shouldBeCropped(), false);
    6464    });
    6565
    66     test('should be cropped when the image has the same dimensions of the theme image', function() {
     66    QUnit.test('should be cropped when the image has the same dimensions of the theme image', function( assert ) {
    6767        this.model.set({
    6868            themeFlexWidth: false,
     
    7272        });
    7373
    74         equal(this.model.shouldBeCropped(), true);
     74        assert.equal(this.model.shouldBeCropped(), true);
    7575    });
    7676
    77     test('should not be cropped when the theme only supports flex width and the image has the same height as the theme image', function() {
     77    QUnit.test('should not be cropped when the theme only supports flex width and the image has the same height as the theme image', function( assert ) {
    7878        this.model.set({
    7979            themeFlexWidth: true,
     
    8383        });
    8484
    85         equal(this.model.shouldBeCropped(), false);
     85        assert.equal(this.model.shouldBeCropped(), false);
    8686    });
    8787
    88     test('should not be cropped when the theme only supports flex height and the image has the same width as the theme image', function() {
     88    QUnit.test('should not be cropped when the theme only supports flex height and the image has the same width as the theme image', function( assert ) {
    8989        this.model.set({
    9090            themeFlexWidth: false,
     
    9494        });
    9595
    96         equal(this.model.shouldBeCropped(), false);
     96        assert.equal(this.model.shouldBeCropped(), false);
    9797    });
    9898
    99     test('should not be cropped when the theme supports flex height AND width', function() {
     99    QUnit.test('should not be cropped when the theme supports flex height AND width', function( assert ) {
    100100        this.model.set({
    101101            themeFlexWidth: true,
     
    105105        });
    106106
    107         equal(this.model.shouldBeCropped(), false);
     107        assert.equal(this.model.shouldBeCropped(), false);
    108108    });
    109109
    110     test('should not be cropped when the image width is smaller than or equal to theme width', function() {
     110    QUnit.test('should not be cropped when the image width is smaller than or equal to theme width', function( assert ) {
    111111        this.model.set({
    112112            themeFlexWidth: false,
     
    116116        });
    117117
    118         equal(this.model.shouldBeCropped(), false);
     118        assert.equal(this.model.shouldBeCropped(), false);
    119119    });
    120120
    121     test('should not be cropped when the image width is smaller than or equal to theme width, theme supports flex height and width', function() {
     121    QUnit.test('should not be cropped when the image width is smaller than or equal to theme width, theme supports flex height and width', function( assert ) {
    122122        this.model.set({
    123123            themeFlexWidth: true,
     
    127127        });
    128128
    129         equal(this.model.shouldBeCropped(), false);
     129        assert.equal(this.model.shouldBeCropped(), false);
    130130    });
    131131});
  • trunk/tests/qunit/wp-admin/js/customize-nav-menus.js

    r47122 r47512  
    11/* global wp */
    2 jQuery( window ).load( function (){
     2jQuery( window ).load( function() {
    33
    44    var api = wp.customize,
     
    66        socialMenuId = 2;
    77
    8     module( 'Customize Nav Menus' );
     8    QUnit.module( 'Customize Nav Menus' );
    99
    1010    /**
    1111     * Generate 20 IDs and verify they are all unique.
    1212     */
    13     test( 'generatePlaceholderAutoIncrementId generates unique IDs', function() {
     13    QUnit.test( 'generatePlaceholderAutoIncrementId generates unique IDs', function( assert ) {
    1414        var testIterations = 20,
    1515            ids = [ api.Menus.generatePlaceholderAutoIncrementId() ];
     
    1818            var placeholderID = api.Menus.generatePlaceholderAutoIncrementId();
    1919
    20             ok( -1 === ids.indexOf( placeholderID ) );
     20            assert.ok( -1 === ids.indexOf( placeholderID ) );
    2121            ids.push( placeholderID );
    2222            testIterations -= 1;
     
    2525    } );
    2626
    27     test( 'it should parse _wpCustomizeMenusSettings.defaults into itself', function() {
    28         deepEqual( window._wpCustomizeNavMenusSettings, api.Menus.data );
     27    QUnit.test( 'it should parse _wpCustomizeMenusSettings.defaults into itself', function( assert ) {
     28        assert.deepEqual( window._wpCustomizeNavMenusSettings, api.Menus.data );
    2929    } );
    3030
    31     test( 'empty menus should have no Menu Item Controls', function() {
    32         ok( 0 === wp.customize.Menus.getMenuControl( socialMenuId ).getMenuItemControls().length, 'empty menus' );
     31    QUnit.test( 'empty menus should have no Menu Item Controls', function( assert ) {
     32        assert.ok( 0 === wp.customize.Menus.getMenuControl( socialMenuId ).getMenuItemControls().length, 'empty menus' );
    3333    } );
    3434
    35     test( 'populated menus should have no Menu Item Controls', function() {
    36         ok( 0 !== wp.customize.Menus.getMenuControl( primaryMenuId ).getMenuItemControls().length, 'non-empty menus' );
     35    QUnit.test( 'populated menus should have no Menu Item Controls', function( assert ) {
     36        assert.ok( 0 !== wp.customize.Menus.getMenuControl( primaryMenuId ).getMenuItemControls().length, 'non-empty menus' );
    3737    } );
    3838
     
    4040    // (and api.Menus.AvailableItemCollection, api.Menus.AvailableItemModel).
    4141
    42     test( 'there is a properly configured MenusPanel', function() {
     42    QUnit.test( 'there is a properly configured MenusPanel', function( assert ) {
    4343        var panel, sections;
    4444
    4545        panel = api.panel( 'nav_menus' );
    46         ok( panel );
    47         ok( panel.extended( api.Menus.MenusPanel ) );
     46        assert.ok( panel );
     47        assert.ok( panel.extended( api.Menus.MenusPanel ) );
    4848
    4949        sections = panel.sections();
    50         ok( 'menu_locations' === sections[0].id, 'first section is menu_locations' );
    51         ok( sections[1].extended( api.Menus.MenuSection ), 'second section is MenuSection' );
    52         ok( sections[ sections.length - 1 ].extended( api.Menus.NewMenuSection ), 'last section is NewMenuSection' );
     50        assert.ok( 'menu_locations' === sections[0].id, 'first section is menu_locations' );
     51        assert.ok( sections[1].extended( api.Menus.MenuSection ), 'second section is MenuSection' );
     52        assert.ok( sections[ sections.length - 1 ].extended( api.Menus.NewMenuSection ), 'last section is NewMenuSection' );
    5353    } );
    5454    // @todo Add more tests for api.Menus.MenusPanel behaviors.
    5555
    56     test( 'there an expected MenuSection for the primary menu', function() {
     56    QUnit.test( 'there an expected MenuSection for the primary menu', function( assert ) {
    5757        var section, controls, lastControl;
    5858
    5959        section = api.section( 'nav_menu[' + primaryMenuId + ']' );
    60         ok( section, 'section exists' );
    61         ok( section.extended( api.Menus.MenuSection ), 'section is a api.Menus.MenuSection' );
    62         ok( section.deferred.initSortables, 'has section.deferred.initSortables' );
    63         ok( section.active(), 'section active() is true' );
    64         ok( section.active.set( false ).get(), 'section active() cannot be set false' );
     60        assert.ok( section, 'section exists' );
     61        assert.ok( section.extended( api.Menus.MenuSection ), 'section is a api.Menus.MenuSection' );
     62        assert.ok( section.deferred.initSortables, 'has section.deferred.initSortables' );
     63        assert.ok( section.active(), 'section active() is true' );
     64        assert.ok( section.active.set( false ).get(), 'section active() cannot be set false' );
    6565
    6666        controls = section.controls();
    67         ok( controls[0].extended( api.Menus.MenuNameControl ), 'first control in menu section is MenuNameControl' );
    68         ok( controls[1].extended( api.Menus.MenuItemControl ), 'second control in menu section is MenuItemControl' );
     67        assert.ok( controls[0].extended( api.Menus.MenuNameControl ), 'first control in menu section is MenuNameControl' );
     68        assert.ok( controls[1].extended( api.Menus.MenuItemControl ), 'second control in menu section is MenuItemControl' );
    6969
    7070        lastControl = controls[ controls.length - 1 ];
    71         ok( lastControl.extended( api.Control ), 'last control in menu section is a base Control' );
    72         ok( lastControl.params.templateId === 'nav-menu-delete-button', 'last control in menu section has a delete-button template' );
     71        assert.ok( lastControl.extended( api.Control ), 'last control in menu section is a base Control' );
     72        assert.ok( lastControl.params.templateId === 'nav-menu-delete-button', 'last control in menu section has a delete-button template' );
    7373    } );
    7474    // @todo Add more tests for api.Menus.MenuSection behaviors.
    7575
    76     test( 'changing a MenuNameControl change the corresponding menu value', function() {
     76    QUnit.test( 'changing a MenuNameControl change the corresponding menu value', function( assert ) {
    7777        var section, control;
    7878
    7979        section = api.section( 'nav_menu[' + primaryMenuId + ']' );
    8080        control = section.controls()[0];
    81         ok( control.extended( api.Menus.MenuNameControl ), 'control is a MenuNameControl' );
    82         equal( control.setting().name, 'Primary menu' );
    83         ok( ! control.setting._dirty );
     81        assert.ok( control.extended( api.Menus.MenuNameControl ), 'control is a MenuNameControl' );
     82        assert.equal( control.setting().name, 'Primary menu' );
     83        assert.ok( ! control.setting._dirty );
    8484        control.container.find( 'input[type=text]:first' ).val( 'Main menu' ).trigger( 'change' );
    85         equal( control.setting().name, 'Main menu' );
    86         ok( control.setting._dirty );
     85        assert.equal( control.setting().name, 'Main menu' );
     86        assert.ok( control.setting._dirty );
    8787    } );
    8888    // @todo Add more tests for api.Menus.MenuNameControl
    8989
    90     test( 'manipulating a MenuItemControl works', function() {
     90    QUnit.test( 'manipulating a MenuItemControl works', function( assert ) {
    9191        var section, control, value;
    9292        section = api.section( 'nav_menu[' + primaryMenuId + ']' );
    93         ok( section );
     93        assert.ok( section );
    9494
    9595        control = section.controls()[1];
    96         ok( control.extended( api.Menus.MenuItemControl ), 'control is a MenuItemControl' );
     96        assert.ok( control.extended( api.Menus.MenuItemControl ), 'control is a MenuItemControl' );
    9797
    9898        control.actuallyEmbed();
    9999
    100100        control.container.find( '.edit-menu-item-title' ).val( 'Hello World' ).trigger( 'change' );
    101         equal( control.setting().title, 'Hello World' );
     101        assert.equal( control.setting().title, 'Hello World' );
    102102        value = _.clone( control.setting() );
    103103        value.title = 'Hola Mundo';
    104         equal( control.container.find( '.edit-menu-item-title' ).val(), 'Hello World' );
    105         equal( value.position, 1 );
    106         equal( control.priority(), 1 );
     104        assert.equal( control.container.find( '.edit-menu-item-title' ).val(), 'Hello World' );
     105        assert.equal( value.position, 1 );
     106        assert.equal( control.priority(), 1 );
    107107
    108108        // @todo Test control.moveDown().
     
    119119    // @todo Add tests for api.Menus.createNavMenu.
    120120
    121     test( 'api.Menus.getMenuControl() should return the expected control', function() {
     121    QUnit.test( 'api.Menus.getMenuControl() should return the expected control', function( assert ) {
    122122        var control = api.Menus.getMenuControl( primaryMenuId );
    123         ok( !! control, 'control is returned' );
    124         ok( control.extended( api.Menus.MenuControl ), 'control is a MenuControl' );
     123        assert.ok( !! control, 'control is returned' );
     124        assert.ok( control.extended( api.Menus.MenuControl ), 'control is a MenuControl' );
    125125    } );
    126126
    127     test( 'api.Menus.getMenuItemControl() should return the expected control', function() {
     127    QUnit.test( 'api.Menus.getMenuItemControl() should return the expected control', function( assert ) {
    128128        var control = api.Menus.getMenuItemControl( 2000 );
    129         ok( !! control, 'control is returned' );
    130         ok( control.extended( api.Menus.MenuItemControl ), 'control is a MenuItemControl' );
     129        assert.ok( !! control, 'control is returned' );
     130        assert.ok( control.extended( api.Menus.MenuItemControl ), 'control is a MenuItemControl' );
    131131    } );
    132132
  • trunk/tests/qunit/wp-admin/js/customize-widgets.js

    r46586 r47512  
    44    var api = wp.customize, $ = jQuery;
    55
    6     module( 'Customize Widgets' );
     6    QUnit.module( 'Customize Widgets' );
    77
    8     test( 'fixtures should be present', function() {
     8    QUnit.test( 'fixtures should be present', function( assert ) {
    99        var widgetControl;
    10         ok( api.panel( 'widgets' ) );
    11         ok( api.section( 'sidebar-widgets-sidebar-1' ) );
     10        assert.ok( api.panel( 'widgets' ) );
     11        assert.ok( api.section( 'sidebar-widgets-sidebar-1' ) );
    1212        widgetControl = api.control( 'widget_search[2]' );
    13         ok( widgetControl );
    14         ok( api.control( 'sidebars_widgets[sidebar-1]' ) );
    15         ok( api( 'widget_search[2]' ) );
    16         ok( api( 'sidebars_widgets[sidebar-1]' ) );
    17         ok( widgetControl.params.content );
    18         ok( widgetControl.params.widget_control );
    19         ok( widgetControl.params.widget_content );
    20         ok( widgetControl.params.widget_id );
    21         ok( widgetControl.params.widget_id_base );
     13        assert.ok( widgetControl );
     14        assert.ok( api.control( 'sidebars_widgets[sidebar-1]' ) );
     15        assert.ok( api( 'widget_search[2]' ) );
     16        assert.ok( api( 'sidebars_widgets[sidebar-1]' ) );
     17        assert.ok( widgetControl.params.content );
     18        assert.ok( widgetControl.params.widget_control );
     19        assert.ok( widgetControl.params.widget_content );
     20        assert.ok( widgetControl.params.widget_id );
     21        assert.ok( widgetControl.params.widget_id_base );
    2222    });
    2323
    24     test( 'widget contents should embed (with widget-added event) when section and control expand', function() {
     24    QUnit.test( 'widget contents should embed (with widget-added event) when section and control expand', function( assert ) {
    2525        var control, section, widgetAddedEvent = null, widgetControlRootElement = null;
    2626        control = api.control( 'widget_search[2]' );
     
    3232        });
    3333
    34         ok( ! section.expanded() );
    35         ok( 0 === control.container.find( '> .widget' ).length );
     34        assert.ok( ! section.expanded() );
     35        assert.ok( 0 === control.container.find( '> .widget' ).length );
    3636
    3737        // Preview sets the active state.
     
    4141
    4242        section.expand();
    43         ok( ! widgetAddedEvent, 'expected widget added event not fired' );
    44         ok( 1 === control.container.find( '> .widget' ).length, 'expected there to be one .widget element in the container' );
    45         ok( 0 === control.container.find( '.widget-content' ).children().length );
     43        assert.ok( ! widgetAddedEvent, 'expected widget added event not fired' );
     44        assert.ok( 1 === control.container.find( '> .widget' ).length, 'expected there to be one .widget element in the container' );
     45        assert.ok( 0 === control.container.find( '.widget-content' ).children().length );
    4646
    4747        control.expand();
    48         ok( 1 === control.container.find( '.widget-content' ).children().length );
    49         ok( widgetAddedEvent );
    50         ok( widgetControlRootElement.is( control.container.find( '> .widget' ) ) );
    51         ok( 1 === control.container.find( '.widget-content #widget-search-2-title' ).length );
     48        assert.ok( 1 === control.container.find( '.widget-content' ).children().length );
     49        assert.ok( widgetAddedEvent );
     50        assert.ok( widgetControlRootElement.is( control.container.find( '> .widget' ) ) );
     51        assert.ok( 1 === control.container.find( '.widget-content #widget-search-2-title' ).length );
    5252
    5353        $( document ).off( 'widget-added' );
    5454    });
    5555
    56     test( 'widgets panel should have notice', function() {
     56    QUnit.test( 'widgets panel should have notice', function( assert ) {
    5757        var panel = api.panel( 'widgets' );
    58         ok( panel.extended( api.Widgets.WidgetsPanel ) );
     58        assert.ok( panel.extended( api.Widgets.WidgetsPanel ) );
    5959
    6060        panel.deferred.embedded.done( function() {
    61             ok( 1 === panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).length );
    62             ok( panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).is( ':visible' ) );
     61            assert.ok( 1 === panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).length );
     62            assert.ok( panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).is( ':visible' ) );
    6363            api.section( 'sidebar-widgets-sidebar-1' ).active( true );
    6464            api.control( 'sidebars_widgets[sidebar-1]' ).active( true );
    6565            api.trigger( 'pane-contents-reflowed' );
    66             ok( ! panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).is( ':visible' ) );
     66            assert.ok( ! panel.contentContainer.find( '.no-widget-areas-rendered-notice' ).is( ':visible' ) );
    6767        } );
    6868
    69         expect( 4 );
     69        assert.expect( 4 );
    7070    });
    7171});
  • trunk/tests/qunit/wp-admin/js/nav-menu.js

    r46586 r47512  
    77
    88    // Fail if we don't see the expected number of events triggered in 3 seconds.
    9     setTimeout( function() {
     9    setTimeout( function( assert ) {
    1010        // QUnit may load this file without running it, in which case `assert`
    1111        // will never be set to `assertPassed` below.
  • trunk/tests/qunit/wp-admin/js/password-strength-meter.js

    r47122 r47512  
    11/* global passwordStrength, wp, jQuery */
    22jQuery( function() {
    3     module( 'password-strength-meter' );
     3    QUnit.module( 'password-strength-meter' );
    44
    5     test( 'mismatched passwords should return 5', function() {
    6         equal( passwordStrength( 'password1', 'username', 'password2' ), 5, 'mismatched passwords return 5' );
     5    QUnit.test( 'mismatched passwords should return 5', function( assert ) {
     6        assert.equal( passwordStrength( 'password1', 'username', 'password2' ), 5, 'mismatched passwords return 5' );
    77    });
    88
    9     test( 'passwords shorter than 4 characters should return 0', function() {
    10         equal( passwordStrength( 'abc', 'username', 'abc' ), 0, 'short passwords return 0' );
     9    QUnit.test( 'passwords shorter than 4 characters should return 0', function( assert ) {
     10        assert.equal( passwordStrength( 'abc', 'username', 'abc' ), 0, 'short passwords return 0' );
    1111    });
    1212
    13     test( 'long complicated passwords should return 4', function() {
     13    QUnit.test( 'long complicated passwords should return 4', function( assert ) {
    1414        var password = function( length ) {
    1515            var i, n, retVal = '',
     
    2222        twofifty = password( 250 );
    2323
    24         equal( passwordStrength( twofifty, 'username', twofifty ), 4, '250 character complicated password returns 4' );
     24        assert.equal( passwordStrength( twofifty, 'username', twofifty ), 4, '250 character complicated password returns 4' );
    2525    });
    2626
    27     test( 'short uncomplicated passwords should return 0', function() {
     27    QUnit.test( 'short uncomplicated passwords should return 0', function( assert ) {
    2828        var letters = 'aaaa',
    2929            numbers = '1111',
    3030            password = 'password',
    3131            uppercase = 'AAAA';
    32         equal( passwordStrength( letters, 'username', letters ), 0, 'password of `' + letters + '` returns 0' );
    33         equal( passwordStrength( numbers, 'username', numbers ), 0, 'password of `' + numbers + '` returns 0' );
    34         equal( passwordStrength( uppercase, 'username', uppercase ), 0, 'password of `' + uppercase + '` returns 0' );
    35         equal( passwordStrength( password, 'username', password ), 0, 'password of `' + password + '` returns 0' );
     32        assert.equal( passwordStrength( letters, 'username', letters ), 0, 'password of `' + letters + '` returns 0' );
     33        assert.equal( passwordStrength( numbers, 'username', numbers ), 0, 'password of `' + numbers + '` returns 0' );
     34        assert.equal( passwordStrength( uppercase, 'username', uppercase ), 0, 'password of `' + uppercase + '` returns 0' );
     35        assert.equal( passwordStrength( password, 'username', password ), 0, 'password of `' + password + '` returns 0' );
    3636    });
    3737
    38     test( 'zxcvbn password tests should return the score we expect', function() {
     38    QUnit.test( 'zxcvbn password tests should return the score we expect', function( assert ) {
    3939        var passwords, i;
    4040        passwords = [
     
    7777
    7878        for ( i = 0; i < passwords.length; i++ ) {
    79             equal( passwordStrength( passwords[i].pw, 'username', passwords[i].pw ), passwords[i].score, 'password of `' + passwords[i].pw + '` returns ' + passwords[i].score );
     79            assert.equal( passwordStrength( passwords[i].pw, 'username', passwords[i].pw ), passwords[i].score, 'password of `' + passwords[i].pw + '` returns ' + passwords[i].score );
    8080        }
    8181    });
    8282
    83     test( 'blacklisted words in password should be penalized', function() {
     83    QUnit.test( 'blacklisted words in password should be penalized', function( assert ) {
    8484        var allowedPasswordScore, penalizedPasswordScore,
    8585            allowedPassword   = 'a[janedoefoe]4',
     
    9090        penalizedPasswordScore = passwordStrength( penalizedPassword, blacklist, penalizedPassword );
    9191
    92         ok( penalizedPasswordScore < allowedPasswordScore, 'Penalized password scored ' + penalizedPasswordScore + '; allowed password scored: ' + allowedPasswordScore );
     92        assert.ok( penalizedPasswordScore < allowedPasswordScore, 'Penalized password scored ' + penalizedPasswordScore + '; allowed password scored: ' + allowedPasswordScore );
    9393    });
    9494
    95     test( 'user input blacklist array should contain expected words', function() {
     95    QUnit.test( 'user input blacklist array should contain expected words', function( assert ) {
    9696        var blacklist = wp.passwordStrength.userInputBlacklist();
    9797
    98         ok( jQuery.isArray( blacklist ), 'blacklist is an array' );
    99         ok( jQuery.inArray( 'WordPress', blacklist ) > -1, 'blacklist contains "WordPress" from page title' );
    100         ok( jQuery.inArray( 'tests', blacklist ) > -1, 'blacklist contains "tests" from site URL' );
     98        assert.ok( jQuery.isArray( blacklist ), 'blacklist is an array' );
     99        assert.ok( jQuery.inArray( 'WordPress', blacklist ) > -1, 'blacklist contains "WordPress" from page title' );
     100        assert.ok( jQuery.inArray( 'tests', blacklist ) > -1, 'blacklist contains "tests" from site URL' );
    101101    });
    102102});
  • trunk/tests/qunit/wp-admin/js/widgets/test-media-gallery-widget.js

    r46586 r47512  
    77    'use strict';
    88
    9     module( 'Gallery Media Widget' );
     9    QUnit.module( 'Gallery Media Widget' );
    1010
    11     test( 'gallery widget control', function() {
     11    QUnit.test( 'gallery widget control', function( assert ) {
    1212        var GalleryWidgetControl;
    13         equal( typeof wp.mediaWidgets.controlConstructors.media_gallery, 'function', 'wp.mediaWidgets.controlConstructors.media_gallery is a function' );
     13        assert.equal( typeof wp.mediaWidgets.controlConstructors.media_gallery, 'function', 'wp.mediaWidgets.controlConstructors.media_gallery is a function' );
    1414        GalleryWidgetControl = wp.mediaWidgets.controlConstructors.media_gallery;
    15         ok( GalleryWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_gallery subclasses wp.mediaWidgets.MediaWidgetControl' );
     15        assert.ok( GalleryWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_gallery subclasses wp.mediaWidgets.MediaWidgetControl' );
    1616    });
    1717
    18     test( 'gallery media model', function() {
     18    QUnit.test( 'gallery media model', function( assert ) {
    1919        var GalleryWidgetModel, galleryWidgetModelInstance;
    20         equal( typeof wp.mediaWidgets.modelConstructors.media_gallery, 'function', 'wp.mediaWidgets.modelConstructors.media_gallery is a function' );
     20        assert.equal( typeof wp.mediaWidgets.modelConstructors.media_gallery, 'function', 'wp.mediaWidgets.modelConstructors.media_gallery is a function' );
    2121        GalleryWidgetModel = wp.mediaWidgets.modelConstructors.media_gallery;
    22         ok( GalleryWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_gallery subclasses wp.mediaWidgets.MediaWidgetModel' );
     22        assert.ok( GalleryWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_gallery subclasses wp.mediaWidgets.MediaWidgetModel' );
    2323
    2424        galleryWidgetModelInstance = new GalleryWidgetModel();
    2525        _.each( galleryWidgetModelInstance.attributes, function( value, key ) {
    26             equal( value, GalleryWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
     26            assert.equal( value, GalleryWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
    2727        });
    2828    });
  • trunk/tests/qunit/wp-admin/js/widgets/test-media-image-widget.js

    r47122 r47512  
    77    'use strict';
    88
    9     module( 'Image Media Widget' );
     9    QUnit.module( 'Image Media Widget' );
    1010
    11     test( 'image widget control', function() {
     11    QUnit.test( 'image widget control', function( assert ) {
    1212        var ImageWidgetControl, imageWidgetControlInstance, imageWidgetModelInstance, mappedProps, testImageUrl, templateProps;
    1313        testImageUrl = 'http://s.w.org/style/images/wp-header-logo.png';
    14         equal( typeof wp.mediaWidgets.controlConstructors.media_image, 'function', 'wp.mediaWidgets.controlConstructors.media_image is a function' );
     14        assert.equal( typeof wp.mediaWidgets.controlConstructors.media_image, 'function', 'wp.mediaWidgets.controlConstructors.media_image is a function' );
    1515        ImageWidgetControl = wp.mediaWidgets.controlConstructors.media_image;
    16         ok( ImageWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_image subclasses wp.mediaWidgets.MediaWidgetControl' );
     16        assert.ok( ImageWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_image subclasses wp.mediaWidgets.MediaWidgetControl' );
    1717
    1818        imageWidgetModelInstance = new wp.mediaWidgets.modelConstructors.media_image();
     
    2525        // Test mapModelToPreviewTemplateProps() when no data is set.
    2626        templateProps = imageWidgetControlInstance.mapModelToPreviewTemplateProps();
    27         equal( templateProps.caption, undefined, 'mapModelToPreviewTemplateProps should not return attributes that are should_preview_update false' );
    28         equal( templateProps.attachment_id, 0, 'mapModelToPreviewTemplateProps should return default values' );
    29         equal( templateProps.currentFilename, '', 'mapModelToPreviewTemplateProps should return a currentFilename' );
     27        assert.equal( templateProps.caption, undefined, 'mapModelToPreviewTemplateProps should not return attributes that are should_preview_update false' );
     28        assert.equal( templateProps.attachment_id, 0, 'mapModelToPreviewTemplateProps should return default values' );
     29        assert.equal( templateProps.currentFilename, '', 'mapModelToPreviewTemplateProps should return a currentFilename' );
    3030
    3131        // Test mapModelToPreviewTemplateProps() when data is set on model.
    3232        imageWidgetControlInstance.model.set( { url: testImageUrl, alt: 'some alt text', link_type: 'none' } );
    3333        templateProps = imageWidgetControlInstance.mapModelToPreviewTemplateProps();
    34         equal( templateProps.currentFilename, 'wp-header-logo.png', 'mapModelToPreviewTemplateProps should set currentFilename based off of url' );
    35         equal( templateProps.url, testImageUrl, 'mapModelToPreviewTemplateProps should return the proper url' );
    36         equal( templateProps.alt, 'some alt text', 'mapModelToPreviewTemplateProps should return the proper alt text' );
    37         equal( templateProps.link_type, undefined, 'mapModelToPreviewTemplateProps should ignore attributes that are not needed in the preview' );
    38         equal( templateProps.error, false, 'mapModelToPreviewTemplateProps should return error state' );
     34        assert.equal( templateProps.currentFilename, 'wp-header-logo.png', 'mapModelToPreviewTemplateProps should set currentFilename based off of url' );
     35        assert.equal( templateProps.url, testImageUrl, 'mapModelToPreviewTemplateProps should return the proper url' );
     36        assert.equal( templateProps.alt, 'some alt text', 'mapModelToPreviewTemplateProps should return the proper alt text' );
     37        assert.equal( templateProps.link_type, undefined, 'mapModelToPreviewTemplateProps should ignore attributes that are not needed in the preview' );
     38        assert.equal( templateProps.error, false, 'mapModelToPreviewTemplateProps should return error state' );
    3939
    4040        // Test mapModelToPreviewTemplateProps() when error is set on model.
    4141        imageWidgetControlInstance.model.set( 'error', 'missing_attachment' );
    4242        templateProps = imageWidgetControlInstance.mapModelToPreviewTemplateProps();
    43         equal( templateProps.error, 'missing_attachment', 'mapModelToPreviewTemplateProps should return error string' );
     43        assert.equal( templateProps.error, 'missing_attachment', 'mapModelToPreviewTemplateProps should return error string' );
    4444
    4545        // Reset model.
     
    4747
    4848        // Test isSelected().
    49         equal( imageWidgetControlInstance.isSelected(), false, 'media_image.isSelected() should return false when no media is selected' );
     49        assert.equal( imageWidgetControlInstance.isSelected(), false, 'media_image.isSelected() should return false when no media is selected' );
    5050        imageWidgetControlInstance.model.set({ error: 'missing_attachment', attachment_id: 777 });
    51         equal( imageWidgetControlInstance.isSelected(), false, 'media_image.isSelected() should return false when media is selected and error is set' );
     51        assert.equal( imageWidgetControlInstance.isSelected(), false, 'media_image.isSelected() should return false when media is selected and error is set' );
    5252        imageWidgetControlInstance.model.set({ error: false, attachment_id: 777 });
    53         equal( imageWidgetControlInstance.isSelected(), true, 'media_image.isSelected() should return true when media is selected and no error exists' );
     53        assert.equal( imageWidgetControlInstance.isSelected(), true, 'media_image.isSelected() should return true when media is selected and no error exists' );
    5454        imageWidgetControlInstance.model.set({ error: false, attachment_id: 0, url: testImageUrl });
    55         equal( imageWidgetControlInstance.isSelected(), true, 'media_image.isSelected() should return true when url is set and no error exists' );
     55        assert.equal( imageWidgetControlInstance.isSelected(), true, 'media_image.isSelected() should return true when url is set and no error exists' );
    5656
    5757        // Reset model.
     
    6161        imageWidgetControlInstance.render();
    6262        imageWidgetControlInstance.$el.find( '.title' ).val( 'Chicken and Ribs' ).trigger( 'input' );
    63         equal( imageWidgetModelInstance.get( 'title' ), 'Chicken and Ribs', 'Changing title should update model title attribute' );
     63        assert.equal( imageWidgetModelInstance.get( 'title' ), 'Chicken and Ribs', 'Changing title should update model title attribute' );
    6464
    6565        // Test mapMediaToModelProps.
    6666        mappedProps = imageWidgetControlInstance.mapMediaToModelProps( { link: 'file', url: testImageUrl } );
    67         equal( mappedProps.link_url, testImageUrl, 'mapMediaToModelProps should set file link_url according to mediaFrameProps.link' );
     67        assert.equal( mappedProps.link_url, testImageUrl, 'mapMediaToModelProps should set file link_url according to mediaFrameProps.link' );
    6868        mappedProps = imageWidgetControlInstance.mapMediaToModelProps( { link: 'post', postUrl: 'https://wordpress.org/image-2/' } );
    69         equal( mappedProps.link_url, 'https://wordpress.org/image-2/', 'mapMediaToModelProps should set file link_url according to mediaFrameProps.link' );
     69        assert.equal( mappedProps.link_url, 'https://wordpress.org/image-2/', 'mapMediaToModelProps should set file link_url according to mediaFrameProps.link' );
    7070        mappedProps = imageWidgetControlInstance.mapMediaToModelProps( { link: 'custom', linkUrl: 'https://wordpress.org' } );
    71         equal( mappedProps.link_url, 'https://wordpress.org', 'mapMediaToModelProps should set custom link_url according to mediaFrameProps.linkUrl' );
     71        assert.equal( mappedProps.link_url, 'https://wordpress.org', 'mapMediaToModelProps should set custom link_url according to mediaFrameProps.linkUrl' );
    7272
    7373        // Test mapModelToMediaFrameProps().
    7474        imageWidgetControlInstance.model.set({ error: false, url: testImageUrl, 'link_type': 'custom', 'link_url': 'https://wordpress.org', 'size': 'custom', 'width': 100, 'height': 150, 'title': 'widget title', 'image_title': 'title of image' });
    7575        mappedProps = imageWidgetControlInstance.mapModelToMediaFrameProps( imageWidgetControlInstance.model.toJSON() );
    76         equal( mappedProps.linkUrl, 'https://wordpress.org', 'mapModelToMediaFrameProps should set linkUrl from model.link_url' );
    77         equal( mappedProps.link, 'custom', 'mapModelToMediaFrameProps should set link from model.link_type' );
    78         equal( mappedProps.width, 100, 'mapModelToMediaFrameProps should set width when model.size is custom' );
    79         equal( mappedProps.height, 150, 'mapModelToMediaFrameProps should set height when model.size is custom' );
    80         equal( mappedProps.title, 'title of image', 'mapModelToMediaFrameProps should set title from model.image_title' );
     76        assert.equal( mappedProps.linkUrl, 'https://wordpress.org', 'mapModelToMediaFrameProps should set linkUrl from model.link_url' );
     77        assert.equal( mappedProps.link, 'custom', 'mapModelToMediaFrameProps should set link from model.link_type' );
     78        assert.equal( mappedProps.width, 100, 'mapModelToMediaFrameProps should set width when model.size is custom' );
     79        assert.equal( mappedProps.height, 150, 'mapModelToMediaFrameProps should set height when model.size is custom' );
     80        assert.equal( mappedProps.title, 'title of image', 'mapModelToMediaFrameProps should set title from model.image_title' );
    8181    });
    8282
    83     test( 'image widget control renderPreview', function( assert ) {
     83    QUnit.test( 'image widget control renderPreview', function( assert ) {
    8484        var imageWidgetControlInstance, imageWidgetModelInstance, done;
    8585        done = assert.async();
     
    9191            model: imageWidgetModelInstance
    9292        });
    93         equal( imageWidgetControlInstance.$el.find( 'img' ).length, 0, 'No images should be rendered' );
     93        assert.equal( imageWidgetControlInstance.$el.find( 'img' ).length, 0, 'No images should be rendered' );
    9494        imageWidgetControlInstance.model.set({ error: false, url: 'http://s.w.org/style/images/wp-header-logo.png' });
    9595
    9696        // Due to renderPreview being deferred.
    9797        setTimeout( function() {
    98             equal( imageWidgetControlInstance.$el.find( 'img[src="http://s.w.org/style/images/wp-header-logo.png"]' ).length, 1, 'One image should be rendered' );
     98            assert.equal( imageWidgetControlInstance.$el.find( 'img[src="http://s.w.org/style/images/wp-header-logo.png"]' ).length, 1, 'One image should be rendered' );
    9999            done();
    100100        }, 50 );
    101101
    102         start();
     102        done();
    103103    });
    104104
    105     test( 'image media model', function() {
     105    QUnit.test( 'image media model', function( assert ) {
    106106        var ImageWidgetModel, imageWidgetModelInstance;
    107         equal( typeof wp.mediaWidgets.modelConstructors.media_image, 'function', 'wp.mediaWidgets.modelConstructors.media_image is a function' );
     107        assert.equal( typeof wp.mediaWidgets.modelConstructors.media_image, 'function', 'wp.mediaWidgets.modelConstructors.media_image is a function' );
    108108        ImageWidgetModel = wp.mediaWidgets.modelConstructors.media_image;
    109         ok( ImageWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_image subclasses wp.mediaWidgets.MediaWidgetModel' );
     109        assert.ok( ImageWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_image subclasses wp.mediaWidgets.MediaWidgetModel' );
    110110
    111111        imageWidgetModelInstance = new ImageWidgetModel();
    112112        _.each( imageWidgetModelInstance.attributes, function( value, key ) {
    113             equal( value, ImageWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
     113            assert.equal( value, ImageWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
    114114        });
    115115    });
  • trunk/tests/qunit/wp-admin/js/widgets/test-media-video-widget.js

    r46586 r47512  
    77    'use strict';
    88
    9     module( 'Video Media Widget' );
     9    QUnit.module( 'Video Media Widget' );
    1010
    11     test( 'video widget control', function() {
     11    QUnit.test( 'video widget control', function( assert ) {
    1212        var VideoWidgetControl, videoWidgetControlInstance, videoWidgetModelInstance, mappedProps, testVideoUrl;
    1313        testVideoUrl = 'https://videos.files.wordpress.com/AHz0Ca46/wp4-7-vaughan-r8-mastered_hd.mp4';
    14         equal( typeof wp.mediaWidgets.controlConstructors.media_video, 'function', 'wp.mediaWidgets.controlConstructors.media_video is a function' );
     14        assert.equal( typeof wp.mediaWidgets.controlConstructors.media_video, 'function', 'wp.mediaWidgets.controlConstructors.media_video is a function' );
    1515        VideoWidgetControl = wp.mediaWidgets.controlConstructors.media_video;
    16         ok( VideoWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_video subclasses wp.mediaWidgets.MediaWidgetControl' );
     16        assert.ok( VideoWidgetControl.prototype instanceof wp.mediaWidgets.MediaWidgetControl, 'wp.mediaWidgets.controlConstructors.media_video subclasses wp.mediaWidgets.MediaWidgetControl' );
    1717
    1818        videoWidgetModelInstance = new wp.mediaWidgets.modelConstructors.media_video();
     
    2626        videoWidgetControlInstance.model.set({ error: false, url: testVideoUrl, loop: false, preload: 'meta' });
    2727        mappedProps = videoWidgetControlInstance.mapModelToMediaFrameProps( videoWidgetControlInstance.model.toJSON() );
    28         equal( mappedProps.url, testVideoUrl, 'mapModelToMediaFrameProps should set url' );
    29         equal( mappedProps.loop, false, 'mapModelToMediaFrameProps should set loop' );
    30         equal( mappedProps.preload, 'meta', 'mapModelToMediaFrameProps should set preload' );
     28        assert.equal( mappedProps.url, testVideoUrl, 'mapModelToMediaFrameProps should set url' );
     29        assert.equal( mappedProps.loop, false, 'mapModelToMediaFrameProps should set loop' );
     30        assert.equal( mappedProps.preload, 'meta', 'mapModelToMediaFrameProps should set preload' );
    3131
    3232        // Test mapMediaToModelProps().
    3333        mappedProps = videoWidgetControlInstance.mapMediaToModelProps( { loop: false, preload: 'meta', url: testVideoUrl, title: 'random movie file title' } );
    34         equal( mappedProps.title, undefined, 'mapMediaToModelProps should ignore title inputs' );
    35         equal( mappedProps.loop, false, 'mapMediaToModelProps should set loop' );
    36         equal( mappedProps.preload, 'meta', 'mapMediaToModelProps should set preload' );
     34        assert.equal( mappedProps.title, undefined, 'mapMediaToModelProps should ignore title inputs' );
     35        assert.equal( mappedProps.loop, false, 'mapMediaToModelProps should set loop' );
     36        assert.equal( mappedProps.preload, 'meta', 'mapMediaToModelProps should set preload' );
    3737    });
    3838
    39     test( 'video widget control renderPreview', function( assert ) {
     39    QUnit.test( 'video widget control renderPreview', function( assert ) {
    4040        var videoWidgetControlInstance, videoWidgetModelInstance, done;
    4141        done = assert.async();
     
    4747            model: videoWidgetModelInstance
    4848        });
    49         equal( videoWidgetControlInstance.$el.find( 'a' ).length, 0, 'No video links should be rendered' );
     49        assert.equal( videoWidgetControlInstance.$el.find( 'a' ).length, 0, 'No video links should be rendered' );
    5050        videoWidgetControlInstance.model.set({ error: false, url: 'https://videos.files.wordpress.com/AHz0Ca46/wp4-7-vaughan-r8-mastered_hd.mp4' });
    5151
    5252        // Due to renderPreview being deferred.
    5353        setTimeout( function() {
    54             equal( videoWidgetControlInstance.$el.find( 'a[href="https://videos.files.wordpress.com/AHz0Ca46/wp4-7-vaughan-r8-mastered_hd.mp4"]' ).length, 1, 'One video link should be rendered' );
     54            assert.equal( videoWidgetControlInstance.$el.find( 'a[href="https://videos.files.wordpress.com/AHz0Ca46/wp4-7-vaughan-r8-mastered_hd.mp4"]' ).length, 1, 'One video link should be rendered' );
    5555            done();
    5656        }, 50 );
    57         start();
     57
     58        done();
    5859    });
    5960
    60     test( 'video media model', function() {
     61    QUnit.test( 'video media model', function( assert ) {
    6162        var VideoWidgetModel, videoWidgetModelInstance;
    62         equal( typeof wp.mediaWidgets.modelConstructors.media_video, 'function', 'wp.mediaWidgets.modelConstructors.media_video is a function' );
     63        assert.equal( typeof wp.mediaWidgets.modelConstructors.media_video, 'function', 'wp.mediaWidgets.modelConstructors.media_video is a function' );
    6364        VideoWidgetModel = wp.mediaWidgets.modelConstructors.media_video;
    64         ok( VideoWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_video subclasses wp.mediaWidgets.MediaWidgetModel' );
     65        assert.ok( VideoWidgetModel.prototype instanceof wp.mediaWidgets.MediaWidgetModel, 'wp.mediaWidgets.modelConstructors.media_video subclasses wp.mediaWidgets.MediaWidgetModel' );
    6566
    6667        videoWidgetModelInstance = new VideoWidgetModel();
    6768        _.each( videoWidgetModelInstance.attributes, function( value, key ) {
    68             equal( value, VideoWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
     69            assert.equal( value, VideoWidgetModel.prototype.schema[ key ][ 'default' ], 'Should properly set default for ' + key );
    6970        });
    7071    });
  • trunk/tests/qunit/wp-admin/js/widgets/test-media-widgets.js

    r46586 r47512  
    33/* eslint-env qunit */
    44
    5 (function() {
     5( function() {
    66    'use strict';
    77
    8     module( 'Media Widgets' );
     8    QUnit.module( 'Media Widgets' );
    99
    10     test( 'namespace', function() {
    11         equal( typeof wp.mediaWidgets, 'object', 'wp.mediaWidgets is an object' );
    12         equal( typeof wp.mediaWidgets.controlConstructors, 'object', 'wp.mediaWidgets.controlConstructors is an object' );
    13         equal( typeof wp.mediaWidgets.modelConstructors, 'object', 'wp.mediaWidgets.modelConstructors is an object' );
    14         equal( typeof wp.mediaWidgets.widgetControls, 'object', 'wp.mediaWidgets.widgetControls is an object' );
    15         equal( typeof wp.mediaWidgets.handleWidgetAdded, 'function', 'wp.mediaWidgets.handleWidgetAdded is an function' );
    16         equal( typeof wp.mediaWidgets.handleWidgetUpdated, 'function', 'wp.mediaWidgets.handleWidgetUpdated is an function' );
    17         equal( typeof wp.mediaWidgets.init, 'function', 'wp.mediaWidgets.init is an function' );
     10    QUnit.test( 'namespace', function( assert ) {
     11        assert.equal( typeof wp.mediaWidgets, 'object', 'wp.mediaWidgets is an object' );
     12        assert.equal( typeof wp.mediaWidgets.controlConstructors, 'object', 'wp.mediaWidgets.controlConstructors is an object' );
     13        assert.equal( typeof wp.mediaWidgets.modelConstructors, 'object', 'wp.mediaWidgets.modelConstructors is an object' );
     14        assert.equal( typeof wp.mediaWidgets.widgetControls, 'object', 'wp.mediaWidgets.widgetControls is an object' );
     15        assert.equal( typeof wp.mediaWidgets.handleWidgetAdded, 'function', 'wp.mediaWidgets.handleWidgetAdded is an function' );
     16        assert.equal( typeof wp.mediaWidgets.handleWidgetUpdated, 'function', 'wp.mediaWidgets.handleWidgetUpdated is an function' );
     17        assert.equal( typeof wp.mediaWidgets.init, 'function', 'wp.mediaWidgets.init is an function' );
    1818    });
    1919
    20     test( 'media widget control', function() {
    21         equal( typeof wp.mediaWidgets.MediaWidgetControl, 'function', 'wp.mediaWidgets.MediaWidgetControl' );
    22         ok( wp.mediaWidgets.MediaWidgetControl.prototype instanceof Backbone.View, 'wp.mediaWidgets.MediaWidgetControl subclasses Backbone.View' );
     20    QUnit.test( 'media widget control', function( assert ) {
     21        assert.equal( typeof wp.mediaWidgets.MediaWidgetControl, 'function', 'wp.mediaWidgets.MediaWidgetControl' );
     22        assert.ok( wp.mediaWidgets.MediaWidgetControl.prototype instanceof Backbone.View, 'wp.mediaWidgets.MediaWidgetControl subclasses Backbone.View' );
    2323    });
    2424
    25     test( 'media widget model', function() {
     25    QUnit.test( 'media widget model', function( assert ) {
    2626        var widgetModelInstance;
    27         equal( typeof wp.mediaWidgets.MediaWidgetModel, 'function', 'wp.mediaWidgets.MediaWidgetModel is a function' );
    28         ok( wp.mediaWidgets.MediaWidgetModel.prototype instanceof Backbone.Model, 'wp.mediaWidgets.MediaWidgetModel subclasses Backbone.Model' );
     27        assert.equal( typeof wp.mediaWidgets.MediaWidgetModel, 'function', 'wp.mediaWidgets.MediaWidgetModel is a function' );
     28        assert.ok( wp.mediaWidgets.MediaWidgetModel.prototype instanceof Backbone.Model, 'wp.mediaWidgets.MediaWidgetModel subclasses Backbone.Model' );
    2929
    3030        widgetModelInstance = new wp.mediaWidgets.MediaWidgetModel();
    31         equal( widgetModelInstance.get( 'title' ), '', 'wp.mediaWidgets.MediaWidgetModel defaults title to empty string' );
    32         equal( widgetModelInstance.get( 'attachment_id' ), 0, 'wp.mediaWidgets.MediaWidgetModel defaults attachment_id to 0' );
    33         equal( widgetModelInstance.get( 'url' ), 0, 'wp.mediaWidgets.MediaWidgetModel defaults url to empty string' );
     31        assert.equal( widgetModelInstance.get( 'title' ), '', 'wp.mediaWidgets.MediaWidgetModel defaults title to empty string' );
     32        assert.equal( widgetModelInstance.get( 'attachment_id' ), 0, 'wp.mediaWidgets.MediaWidgetModel defaults attachment_id to 0' );
     33        assert.equal( widgetModelInstance.get( 'url' ), 0, 'wp.mediaWidgets.MediaWidgetModel defaults url to empty string' );
    3434
    3535        widgetModelInstance.set({
     
    3838            url: 'https://wordpress.org'
    3939        });
    40         equal( widgetModelInstance.get( 'title' ), 'chicken and ribs', 'wp.mediaWidgets.MediaWidgetModel properly sets the title attribute' );
    41         equal( widgetModelInstance.get( 'url' ), 'https://wordpress.org', 'wp.mediaWidgets.MediaWidgetModel properly sets the url attribute' );
    42         equal( widgetModelInstance.get( 'attachment_id' ), 1, 'wp.mediaWidgets.MediaWidgetModel properly sets and casts the attachment_id attribute' );
     40        assert.equal( widgetModelInstance.get( 'title' ), 'chicken and ribs', 'wp.mediaWidgets.MediaWidgetModel properly sets the title attribute' );
     41        assert.equal( widgetModelInstance.get( 'url' ), 'https://wordpress.org', 'wp.mediaWidgets.MediaWidgetModel properly sets the url attribute' );
     42        assert.equal( widgetModelInstance.get( 'attachment_id' ), 1, 'wp.mediaWidgets.MediaWidgetModel properly sets and casts the attachment_id attribute' );
    4343    });
    4444
  • trunk/tests/qunit/wp-includes/js/shortcode.js

    r47122 r47512  
    11/* global wp, jQuery */
    22jQuery( function() {
    3     module( 'shortcode' );
    4 
    5     test( 'next() should find the shortcode', function() {
     3    QUnit.module( 'shortcode' );
     4
     5    QUnit.test( 'next() should find the shortcode', function( assert ) {
    66        var result;
    77
    88        // Basic.
    99        result = wp.shortcode.next( 'foo', 'this has the [foo] shortcode' );
    10         equal( result.index, 13, 'foo shortcode found at index 13' );
     10        assert.equal( result.index, 13, 'foo shortcode found at index 13' );
    1111
    1212        result = wp.shortcode.next( 'foo', 'this has the [foo param="foo"] shortcode' );
    13         equal( result.index, 13, 'foo shortcode with params found at index 13' );
    14     });
    15 
    16     test( 'next() should not find shortcodes that are not there', function() {
     13        assert.equal( result.index, 13, 'foo shortcode with params found at index 13' );
     14    });
     15
     16    QUnit.test( 'next() should not find shortcodes that are not there', function( assert ) {
    1717        var result;
    1818
    1919        // Not found.
    2020        result = wp.shortcode.next( 'bar', 'this has the [foo] shortcode' );
    21         equal( result, undefined, 'bar shortcode not found' );
     21        assert.equal( result, undefined, 'bar shortcode not found' );
    2222
    2323        result = wp.shortcode.next( 'bar', 'this has the [foo param="bar"] shortcode' );
    24         equal( result, undefined, 'bar shortcode not found with params' );
    25     });
    26 
    27     test( 'next() should find the shortcode when told to start looking beyond the start of the string', function() {
     24        assert.equal( result, undefined, 'bar shortcode not found with params' );
     25    });
     26
     27    QUnit.test( 'next() should find the shortcode when told to start looking beyond the start of the string', function( assert ) {
    2828        var result;
    2929
    3030        // Starting at indices.
    3131        result = wp.shortcode.next( 'foo', 'this has the [foo] shortcode', 12 );
    32         equal( result.index, 13, 'foo shortcode found before index 13' );
     32        assert.equal( result.index, 13, 'foo shortcode found before index 13' );
    3333
    3434        result = wp.shortcode.next( 'foo', 'this has the [foo] shortcode', 13 );
    35         equal( result.index, 13, 'foo shortcode found at index 13' );
     35        assert.equal( result.index, 13, 'foo shortcode found at index 13' );
    3636
    3737        result = wp.shortcode.next( 'foo', 'this has the [foo] shortcode', 14 );
    38         equal( result, undefined, 'foo shortcode not found after index 13' );
    39     });
    40 
    41     test( 'next() should find the second instances of the shortcode when the starting indice is after the start of the first one', function() {
     38        assert.equal( result, undefined, 'foo shortcode not found after index 13' );
     39    });
     40
     41    QUnit.test( 'next() should find the second instances of the shortcode when the starting indice is after the start of the first one', function( assert ) {
    4242        var result;
    4343
    4444        result = wp.shortcode.next( 'foo', 'this has the [foo] shortcode [foo] twice', 14 );
    45         equal( result.index, 29, 'foo shortcode found the second foo at index 29' );
    46     });
    47 
    48 
    49     test( 'next() should not find escaped shortcodes', function() {
     45        assert.equal( result.index, 29, 'foo shortcode found the second foo at index 29' );
     46    });
     47
     48
     49    QUnit.test( 'next() should not find escaped shortcodes', function( assert ) {
    5050        var result;
    5151
    5252        // Escaped.
    5353        result = wp.shortcode.next( 'foo', 'this has the [[foo]] shortcode' );
    54         equal( result, undefined, 'foo shortcode not found when escaped' );
     54        assert.equal( result, undefined, 'foo shortcode not found when escaped' );
    5555
    5656        result = wp.shortcode.next( 'foo', 'this has the [[foo param="foo"]] shortcode' );
    57         equal( result, undefined, 'foo shortcode not found when escaped with params' );
    58     });
    59 
    60     test( 'next() should find shortcodes that are incorrectly escaped by newlines', function() {
     57        assert.equal( result, undefined, 'foo shortcode not found when escaped with params' );
     58    });
     59
     60    QUnit.test( 'next() should find shortcodes that are incorrectly escaped by newlines', function( assert ) {
    6161        var result;
    6262
    6363        result = wp.shortcode.next( 'foo', 'this has the [\n[foo]] shortcode' );
    64         equal( result.index, 15, 'shortcode found when incorrectly escaping the start of it' );
     64        assert.equal( result.index, 15, 'shortcode found when incorrectly escaping the start of it' );
    6565
    6666        result = wp.shortcode.next( 'foo', 'this has the [[foo]\n] shortcode' );
    67         equal( result.index, 14, 'shortcode found when incorrectly escaping the end of it' );
    68     });
    69 
    70     test( 'next() should still work when there are not equal ammounts of square brackets', function() {
     67        assert.equal( result.index, 14, 'shortcode found when incorrectly escaping the end of it' );
     68    });
     69
     70    QUnit.test( 'next() should still work when there are not equal ammounts of square brackets', function( assert ) {
    7171        var result;
    7272
    7373        result = wp.shortcode.next( 'foo', 'this has the [[foo] shortcode' );
    74         equal( result.index, 14, 'shortcode found when there are offset square brackets' );
     74        assert.equal( result.index, 14, 'shortcode found when there are offset square brackets' );
    7575
    7676        result = wp.shortcode.next( 'foo', 'this has the [foo]] shortcode' );
    77         equal( result.index, 13, 'shortcode found when there are offset square brackets' );
    78     });
    79 
    80     test( 'next() should find the second instances of the shortcode when the first one is escaped', function() {
     77        assert.equal( result.index, 13, 'shortcode found when there are offset square brackets' );
     78    });
     79
     80    QUnit.test( 'next() should find the second instances of the shortcode when the first one is escaped', function( assert ) {
    8181        var result;
    8282
    8383
    8484        result = wp.shortcode.next( 'foo', 'this has the [[foo]] shortcode [foo] twice' );
    85         equal( result.index, 31, 'foo shortcode found the non-escaped foo at index 31' );
    86     });
    87 
    88     test( 'next() should not find shortcodes that are not full matches', function() {
     85        assert.equal( result.index, 31, 'foo shortcode found the non-escaped foo at index 31' );
     86    });
     87
     88    QUnit.test( 'next() should not find shortcodes that are not full matches', function( assert ) {
    8989        var result;
    9090
    9191        // Stubs.
    9292        result = wp.shortcode.next( 'foo', 'this has the [foobar] shortcode' );
    93         equal( result, undefined, 'stub does not trigger match' );
     93        assert.equal( result, undefined, 'stub does not trigger match' );
    9494
    9595        result = wp.shortcode.next( 'foobar', 'this has the [foo] shortcode' );
    96         equal( result, undefined, 'stub does not trigger match' );
    97     });
    98 
    99     test( 'replace() should replace the shortcode', function() {
     96        assert.equal( result, undefined, 'stub does not trigger match' );
     97    });
     98
     99    QUnit.test( 'replace() should replace the shortcode', function( assert ) {
    100100        var result;
    101101
    102102        // Basic.
    103103        result = wp.shortcode.replace( 'foo', 'this has the [foo] shortcode', shortcodeReplaceCallback );
    104         equal( result, 'this has the bar shortcode', 'foo replaced with bar' );
     104        assert.equal( result, 'this has the bar shortcode', 'foo replaced with bar' );
    105105
    106106        result = wp.shortcode.replace( 'foo', 'this has the [foo param="foo"] shortcode', shortcodeReplaceCallback );
    107         equal( result, 'this has the bar shortcode', 'foo and params replaced with bar' );
    108     });
    109 
    110     test( 'replace() should not replace the shortcode when it does not match', function() {
     107        assert.equal( result, 'this has the bar shortcode', 'foo and params replaced with bar' );
     108    });
     109
     110    QUnit.test( 'replace() should not replace the shortcode when it does not match', function( assert ) {
    111111        var result;
    112112
    113113        // Not found.
    114114        result = wp.shortcode.replace( 'bar', 'this has the [foo] shortcode', shortcodeReplaceCallback );
    115         equal( result, 'this has the [foo] shortcode', 'bar not found' );
     115        assert.equal( result, 'this has the [foo] shortcode', 'bar not found' );
    116116
    117117        result = wp.shortcode.replace( 'bar', 'this has the [foo param="bar"] shortcode', shortcodeReplaceCallback );
    118         equal( result, 'this has the [foo param="bar"] shortcode', 'bar not found with params' );
    119     });
    120 
    121     test( 'replace() should replace the shortcode in all instances of its use', function() {
     118        assert.equal( result, 'this has the [foo param="bar"] shortcode', 'bar not found with params' );
     119    });
     120
     121    QUnit.test( 'replace() should replace the shortcode in all instances of its use', function( assert ) {
    122122        var result;
    123123
    124124        // Multiple instances.
    125125        result = wp.shortcode.replace( 'foo', 'this has the [foo] shortcode [foo] twice', shortcodeReplaceCallback );
    126         equal( result, 'this has the bar shortcode bar twice', 'foo replaced with bar twice' );
     126        assert.equal( result, 'this has the bar shortcode bar twice', 'foo replaced with bar twice' );
    127127
    128128        result = wp.shortcode.replace( 'foo', 'this has the [foo param="foo"] shortcode [foo] twice', shortcodeReplaceCallback );
    129         equal( result, 'this has the bar shortcode bar twice', 'foo and params replaced with bar twice' );
    130     });
    131 
    132     test( 'replace() should not replace the escaped shortcodes', function() {
     129        assert.equal( result, 'this has the bar shortcode bar twice', 'foo and params replaced with bar twice' );
     130    });
     131
     132    QUnit.test( 'replace() should not replace the escaped shortcodes', function( assert ) {
    133133        var result;
    134134
    135135        // Escaped.
    136136        result = wp.shortcode.replace( 'foo', 'this has the [[foo]] shortcode', shortcodeReplaceCallback );
    137         equal( result, 'this has the [[foo]] shortcode', 'escaped foo not replaced' );
     137        assert.equal( result, 'this has the [[foo]] shortcode', 'escaped foo not replaced' );
    138138
    139139        result = wp.shortcode.replace( 'foo', 'this has the [[foo param="bar"]] shortcode', shortcodeReplaceCallback );
    140         equal( result, 'this has the [[foo param="bar"]] shortcode', 'escaped foo with params not replaced' );
     140        assert.equal( result, 'this has the [[foo param="bar"]] shortcode', 'escaped foo with params not replaced' );
    141141
    142142        result = wp.shortcode.replace( 'foo', 'this [foo] has the [[foo param="bar"]] shortcode escaped', shortcodeReplaceCallback );
    143         equal( result, 'this bar has the [[foo param="bar"]] shortcode escaped', 'escaped foo with params not replaced but unescaped foo replaced' );
    144     });
    145 
    146     test( 'replace() should replace improperly escaped shortcodes that include newlines', function() {
     143        assert.equal( result, 'this bar has the [[foo param="bar"]] shortcode escaped', 'escaped foo with params not replaced but unescaped foo replaced' );
     144    });
     145
     146    QUnit.test( 'replace() should replace improperly escaped shortcodes that include newlines', function( assert ) {
    147147        var result;
    148148
    149149        result = wp.shortcode.replace( 'foo', 'this [foo] has the [[foo param="bar"]\n] shortcode ', shortcodeReplaceCallback );
    150         equal( result, 'this bar has the [bar\n] shortcode ', 'escaping with newlines should not actually escape the content' );
     150        assert.equal( result, 'this bar has the [bar\n] shortcode ', 'escaping with newlines should not actually escape the content' );
    151151
    152152        result = wp.shortcode.replace( 'foo', 'this [foo] has the [\n[foo param="bar"]] shortcode ', shortcodeReplaceCallback );
    153         equal( result, 'this bar has the [\nbar] shortcode ', 'escaping with newlines should not actually escape the content' );
    154     });
    155 
    156     test( 'replace() should not replace the shortcode when it is an incomplete match', function() {
     153        assert.equal( result, 'this bar has the [\nbar] shortcode ', 'escaping with newlines should not actually escape the content' );
     154    });
     155
     156    QUnit.test( 'replace() should not replace the shortcode when it is an incomplete match', function( assert ) {
    157157        var result;
    158158
    159159        // Stubs.
    160160        result = wp.shortcode.replace( 'foo', 'this has the [foobar] shortcode', shortcodeReplaceCallback );
    161         equal( result, 'this has the [foobar] shortcode', 'stub not replaced' );
     161        assert.equal( result, 'this has the [foobar] shortcode', 'stub not replaced' );
    162162
    163163        result = wp.shortcode.replace( 'foobar', 'this has the [foo] shortcode', shortcodeReplaceCallback );
    164         equal( result, 'this has the [foo] shortcode', 'stub not replaced' );
     164        assert.equal( result, 'this has the [foo] shortcode', 'stub not replaced' );
    165165    });
    166166
     
    172172    }
    173173
    174     test( 'attrs() should return named attributes created with single, double, and no quotes', function() {
     174    QUnit.test( 'attrs() should return named attributes created with single, double, and no quotes', function( assert ) {
    175175        var expected = {
    176176            'named': {
     
    181181        };
    182182
    183         deepEqual( wp.shortcode.attrs('param="foo" another=\'bar\' andagain=baz'), expected, 'attr parsed all three named types');
     183        assert.deepEqual( wp.shortcode.attrs('param="foo" another=\'bar\' andagain=baz'), expected, 'attr parsed all three named types');
    184184    });
    185185
    186     test( 'attrs() should return numeric attributes in the order they are used', function() {
     186    QUnit.test( 'attrs() should return numeric attributes in the order they are used', function( assert ) {
    187187        var expected = {
    188188            'named': {}, 'numeric' : ['foo', 'bar', 'baz']
    189189        };
    190190
    191         deepEqual( wp.shortcode.attrs('foo bar baz'), expected, 'attr parsed numeric attributes');
     191        assert.deepEqual( wp.shortcode.attrs('foo bar baz'), expected, 'attr parsed numeric attributes');
    192192    });
    193193
    194     test( 'attrs() should return numeric attributes in the order they are used when they have named attributes in between', function() {
     194    QUnit.test( 'attrs() should return numeric attributes in the order they are used when they have named attributes in between', function( assert ) {
    195195        var expected = {
    196196            'named': { 'not': 'a blocker'  }, 'numeric' : ['foo', 'bar', 'baz']
    197197        };
    198198
    199         deepEqual( wp.shortcode.attrs('foo not="a blocker" bar baz'), expected, 'attr parsed numeric attributes');
     199        assert.deepEqual( wp.shortcode.attrs('foo not="a blocker" bar baz'), expected, 'attr parsed numeric attributes');
    200200    });
    201201
    202     test( 'attrs() should return numeric attributes created with single, double, and no quotes', function() {
     202    QUnit.test( 'attrs() should return numeric attributes created with single, double, and no quotes', function( assert ) {
    203203        var expected = {
    204204            'named': {}, 'numeric' : ['foo', 'bar', 'baz']
    205205        };
    206206
    207         deepEqual( wp.shortcode.attrs('foo "bar" \'baz\''), expected, 'attr parsed numeric attributes');
     207        assert.deepEqual( wp.shortcode.attrs('foo "bar" \'baz\''), expected, 'attr parsed numeric attributes');
    208208    });
    209209   
    210     test( 'attrs() should return mixed attributes created with single, double, and no quotes', function() {
     210    QUnit.test( 'attrs() should return mixed attributes created with single, double, and no quotes', function( assert ) {
    211211        var expected = {
    212212            'named': { a: 'foo', b: 'bar', c: 'baz' }, 'numeric' : ['foo', 'bar', 'baz']
    213213        };
    214214
    215         deepEqual( wp.shortcode.attrs('a="foo" b=\'bar\' c=baz foo "bar" \'baz\''), expected, 'attr parsed numeric attributes');
    216     });
    217 
    218     test( 'string() should accept attrs in any order', function() {
     215        assert.deepEqual( wp.shortcode.attrs('a="foo" b=\'bar\' c=baz foo "bar" \'baz\''), expected, 'attr parsed numeric attributes');
     216    });
     217
     218    QUnit.test( 'string() should accept attrs in any order', function( assert ) {
    219219        var expected = '[short abc123 foo="bar"]';
    220220        var result;
     
    228228            }
    229229        });
    230         deepEqual( result, expected, 'attributes are accepted in any order' );
     230        assert.deepEqual( result, expected, 'attributes are accepted in any order' );
    231231
    232232        result = wp.shortcode.string({
     
    238238            }
    239239        });
    240         deepEqual( result, expected, 'attributes are accepted in any order' );
     240        assert.deepEqual( result, expected, 'attributes are accepted in any order' );
    241241    });
    242242});
  • trunk/tests/qunit/wp-includes/js/tinymce/tinymce-obsolete.js

    r40585 r47512  
    8282    // Ref: http://www.w3.org/TR/html5/obsolete.html, http://developers.whatwg.org/obsolete.html
    8383
    84     QUnit.test('HTML elements non-conforming to HTML 5.0', function() {
     84    QUnit.test('HTML elements non-conforming to HTML 5.0', function( assert ) {
    8585        var testString;
    8686
     
    110110        */
    111111
    112         expect(6);
     112        assert.expect(6);
    113113
    114114        text = 'acronym';
    115115        testString = '<p><acronym title="www">WWW</acronym></p>';
    116116        editor.setContent( testString );
    117         equal( editor.getContent(), testString, text );
     117        assert.equal( editor.getContent(), testString, text );
    118118
    119119        text = 'strike, converted to span';
    120120        editor.setContent( '<strike>test</strike>' );
    121         equal( editor.getContent(), '<p><span style="text-decoration: line-through;">test</span></p>', text );
     121        assert.equal( editor.getContent(), '<p><span style="text-decoration: line-through;">test</span></p>', text );
    122122
    123123        text = 'big';
    124124        testString = '<p><big>test</big></p>';
    125125        editor.setContent( testString );
    126         equal( editor.getContent(), testString, text );
     126        assert.equal( editor.getContent(), testString, text );
    127127
    128128        text = 'center';
    129129        testString = '<center>test</center>';
    130130        editor.setContent( testString );
    131         equal( editor.getContent(), testString, text );
     131        assert.equal( editor.getContent(), testString, text );
    132132
    133133        text = 'font, converted to span';
    134134        editor.setContent( '<p><font size="4">test</font></p>' );
    135         equal( editor.getContent(), '<p><span style="font-size: large;">test</span></p>', text );
     135        assert.equal( editor.getContent(), '<p><span style="font-size: large;">test</span></p>', text );
    136136
    137137        text = 'tt';
    138138        testString = '<p><tt>test</tt></p>';
    139139        editor.setContent( testString );
    140         equal( editor.getContent(), testString, text );
     140        assert.equal( editor.getContent(), testString, text );
    141141    });
    142142
    143     QUnit.test('Obsolete (but still conforming) HTML attributes', function() {
     143    QUnit.test('Obsolete (but still conforming) HTML attributes', function( assert ) {
    144144        var testString;
    145145
    146         expect(3);
     146        assert.expect(3);
    147147
    148148        text = 'border on <img>';
    149149        testString = '<p><img src="../../test.gif" alt="" border="5" /></p>';
    150150        editor.setContent( testString );
    151         equal( editor.getContent(), testString, text );
     151        assert.equal( editor.getContent(), testString, text );
    152152
    153153        text = 'Old style anchors';
    154154        testString = '<p><a name="test"></a></p>';
    155155        editor.setContent( testString );
    156         equal( editor.getContent(), testString, text );
     156        assert.equal( editor.getContent(), testString, text );
    157157
    158158        text = 'maxlength, size on input type="number"';
    159159        testString = '<p><input maxlength="5" size="10" type="number" value="" /></p>';
    160160        editor.setContent( testString );
    161         ok( hasAttr( editor.getContent(), { input: 'maxlength size' } ), text );
     161        assert.ok( hasAttr( editor.getContent(), { input: 'maxlength size' } ), text );
    162162    });
    163163
    164     QUnit.test('Obsolete attributes in HTML 5.0', function() {
     164    QUnit.test('Obsolete attributes in HTML 5.0', function( assert ) {
    165165        var testString, text;
    166166
    167         expect(22);
     167        assert.expect(22);
    168168
    169169        text = 'charset, rev, shape, coords on <a> elements';
    170170        testString = '<p><a href="javascript;:" charset="en" rev="made" shape="rect" coords="5,5">test</a></p>';
    171171        editor.setContent( testString );
    172         ok( hasAttr( editor.getContent(), { a: 'charset rev shape coords' } ), text );
     172        assert.ok( hasAttr( editor.getContent(), { a: 'charset rev shape coords' } ), text );
    173173
    174174        text = 'name, align, hspace, vspace on img elements';
    175175        testString = '<p><img src="../../test.gif" alt="" name="test" align="left" hspace="5" vspace="5" /></p>';
    176176        editor.setContent( testString );
    177         ok( hasAttr( editor.getContent(), { img: 'name align hspace vspace' } ), text );
     177        assert.ok( hasAttr( editor.getContent(), { img: 'name align hspace vspace' } ), text );
    178178
    179179        text = 'name, align, hspace, vspace, on embed elements';
    180180        testString = '<p><embed width="100" height="100" src="test.swf" vspace="5" hspace="5" align="left" name="test"></embed></p>';
    181181        editor.setContent( testString );
    182         ok( hasAttr( editor.getContent(), { embed: 'name align hspace vspace' } ), text );
     182        assert.ok( hasAttr( editor.getContent(), { embed: 'name align hspace vspace' } ), text );
    183183
    184184        text = 'archive, classid, code, codebase, codetype, declare, standby on object elements';
    185185        testString = '<p><object width="100" height="100" classid="clsid" codebase="clsid" standby="standby" codetype="1" code="1" archive="1" declare="declare"></object></p>';
    186186        editor.setContent( testString );
    187         ok( hasAttr( editor.getContent(), { object: 'archive classid code codebase codetype declare standby' } ), text );
     187        assert.ok( hasAttr( editor.getContent(), { object: 'archive classid code codebase codetype declare standby' } ), text );
    188188
    189189        text = 'type, valuetype on param elements';
    190190        testString = '<p><object width="100" height="100"><param type="" valuetype="" /></object></p>';
    191191        editor.setContent( testString );
    192         ok( hasAttr( editor.getContent(), { param: 'type valuetype' } ), text );
     192        assert.ok( hasAttr( editor.getContent(), { param: 'type valuetype' } ), text );
    193193
    194194        text = 'align, bgcolor, border, cellpadding, cellspacing, frame, rules, summary, width on table elements';
    195195        testString = '<table border="1" summary="" width="100" frame="" rules="" cellspacing="5" cellpadding="5" align="left" bgcolor="blue"><tbody><tr><td>test</td></tr></tbody></table>';
    196196        editor.setContent( testString );
    197         ok( hasAttr( editor.getContent(), { table: 'align bgcolor border cellpadding cellspacing frame rules summary width' } ), text );
     197        assert.ok( hasAttr( editor.getContent(), { table: 'align bgcolor border cellpadding cellspacing frame rules summary width' } ), text );
    198198
    199199        text = 'align, char, charoff, valign on tbody, thead, and tfoot elements';
    200200        testString = '<table><thead align="left" char="" charoff="" valign="top"></thead><tfoot align="left" char="" charoff="" valign="top"></tfoot><tbody align="left" char="" charoff="" valign="top"><tr><th>test</th><td>test</td></tr></tbody></table>';
    201201        editor.setContent( testString );
    202         ok( hasAttr( editor.getContent(), {
     202        assert.ok( hasAttr( editor.getContent(), {
    203203            thead: 'align char charoff valign',
    204204            tfoot: 'align char charoff valign',
     
    209209        testString = '<table><tbody><tr><th axis="" align="left" char="" charoff="" valign="top" nowrap="nowrap" bgcolor="blue" width="100" height="10">test</th><td axis="" align="left" char="" charoff="" valign="top" nowrap="nowrap" bgcolor="blue" width="100" height="10" scope="">test</td></tr></tbody></table>';
    210210        editor.setContent( testString );
    211         ok( hasAttr( editor.getContent(), {
     211        assert.ok( hasAttr( editor.getContent(), {
    212212            th: 'axis align bgcolor char charoff height nowrap valign width',
    213213            td: 'axis align bgcolor char charoff height nowrap valign width scope'
     
    217217        testString = '<table><tbody><tr align="left" char="" charoff="" valign="top" bgcolor="blue"><td>test</td></tr></tbody></table>';
    218218        editor.setContent( testString );
    219         ok( hasAttr( editor.getContent(), { tr: 'align bgcolor char charoff valign' } ), text );
     219        assert.ok( hasAttr( editor.getContent(), { tr: 'align bgcolor char charoff valign' } ), text );
    220220
    221221        text = 'clear on br elements';
    222222        testString = '<p>test<br clear="all" />test</p>';
    223223        editor.setContent( testString );
    224         equal( editor.getContent(), testString, text );
     224        assert.equal( editor.getContent(), testString, text );
    225225
    226226        text = 'align on caption elements';
    227227        testString = '<table><caption align="left">test</caption><tbody><tr><td>test</td></tr></tbody></table>';
    228228        editor.setContent( testString );
    229         equal( editor.getContent(), testString, text );
     229        assert.equal( editor.getContent(), testString, text );
    230230
    231231        text = 'align, char, charoff, valign, width on col elements';
    232232        testString = '<table><colgroup><col width="100" align="left" char="a" charoff="1" valign="top" /><col /></colgroup><tbody><tr><td>test</td><td>test</td></tr></tbody></table>';
    233233        editor.setContent( testString );
    234         ok( hasAttr( editor.getContent(), { col: 'align char charoff valign width' } ), text );
     234        assert.ok( hasAttr( editor.getContent(), { col: 'align char charoff valign width' } ), text );
    235235
    236236        text = 'align on div, h1—h6, input, legend, p elements';
    237237        testString = '<div align="left">1</div><h3 align="left">1</h3><p align="left">1</p><form><fieldset><legend align="left">test</legend><input type="text" align="left" /></fieldset></form>';
    238238        editor.setContent( testString );
    239         equal( editor.getContent(), testString, text );
     239        assert.equal( editor.getContent(), testString, text );
    240240
    241241        text = 'compact on dl elements';
    242242        testString = '<dl compact="compact"><dd>1</dd></dl>';
    243243        editor.setContent( testString );
    244         equal( editor.getContent(), testString, text );
     244        assert.equal( editor.getContent(), testString, text );
    245245
    246246        text = 'align, hspace, vspace on embed elements';
    247247        testString = '<p><embed width="100" height="100" vspace="5" hspace="5" align="left"></embed></p>';
    248248        editor.setContent( testString );
    249         ok( hasAttr( editor.getContent(), { embed: 'align hspace vspace' } ), text );
     249        assert.ok( hasAttr( editor.getContent(), { embed: 'align hspace vspace' } ), text );
    250250
    251251        text = 'align, noshade, size, width on hr elements';
    252252        testString = '<hr align="left" noshade="noshade" size="1" width="100" />';
    253253        editor.setContent( testString );
    254         ok( hasAttr( editor.getContent(), { hr: 'align noshade size width' } ), text );
     254        assert.ok( hasAttr( editor.getContent(), { hr: 'align noshade size width' } ), text );
    255255
    256256        text = 'align, frameborder, marginheight, marginwidth, scrolling on iframe elements';
    257257        testString = '<p><iframe width="100" height="100" frameborder="1" marginwidth="5" marginheight="5" scrolling="" align="left"></iframe></p>';
    258258        editor.setContent( testString );
    259         ok( hasAttr( editor.getContent(), { iframe: 'align frameborder marginheight marginwidth scrolling' } ), text );
     259        assert.ok( hasAttr( editor.getContent(), { iframe: 'align frameborder marginheight marginwidth scrolling' } ), text );
    260260
    261261        text = 'type on li elements';
    262262        testString = '<ul><li type="disc">test</li></ul>';
    263263        editor.setContent( testString );
    264         equal( editor.getContent(), testString, text );
     264        assert.equal( editor.getContent(), testString, text );
    265265
    266266        text = 'align, border, hspace, vspace on object elements';
    267267        testString = '<p><object width="100" height="100" border="1" vspace="5" hspace="5" align="left"></object></p>';
    268268        editor.setContent( testString );
    269         ok( hasAttr( editor.getContent(), { object: 'align border hspace vspace' } ), text );
     269        assert.ok( hasAttr( editor.getContent(), { object: 'align border hspace vspace' } ), text );
    270270
    271271        text = 'compact on ol elements';
    272272        testString = '<ol compact="compact"><li>test</li></ol>';
    273273        editor.setContent( testString );
    274         equal( editor.getContent(), testString, text );
     274        assert.equal( editor.getContent(), testString, text );
    275275
    276276        text = 'compact, type on ul elements';
    277277        testString = '<ul type="disc" compact="compact"><li>test</li></ul>';
    278278        editor.setContent( testString );
    279         ok( hasAttr( editor.getContent(), { ul: 'compact type' } ), text );
     279        assert.ok( hasAttr( editor.getContent(), { ul: 'compact type' } ), text );
    280280
    281281        text = 'width on pre elements';
    282282        testString = '<pre width="100">1</pre>';
    283283        editor.setContent( testString );
    284         equal( editor.getContent(), testString, text );
     284        assert.equal( editor.getContent(), testString, text );
    285285    });
    286286
  • trunk/tests/qunit/wp-includes/js/wp-api.js

    r46586 r47512  
    11/* global wp, JSON */
    22( function( QUnit ) {
    3     module( 'wpapi' );
     3    QUnit.module( 'wpapi' );
    44
    55    QUnit.test( 'API Loaded correctly', function( assert ) {
     
    123123    _.each( modelsWithIdsClassNames, function( className ) {
    124124
    125         QUnit.test( 'Checking ' + className + ' model.' , function( assert ) {
     125        QUnit.test( 'Checking ' + className + ' model.', function( assert ) {
    126126            var done = assert.async();
    127127
     
    161161    _.each( modelsWithIndexes, function( className ) {
    162162
    163         QUnit.test( 'Testing ' + className + ' model.' , function( assert ) {
     163        QUnit.test( 'Testing ' + className + ' model.', function( assert ) {
    164164            var done = assert.async();
    165165
     
    297297        // Check that we have and can get each model type.
    298298        _.each( customClasses, function( className ) {
    299             QUnit.test( 'Checking ' + className + ' class name.' , function( assert ) {
     299            QUnit.test( 'Checking ' + className + ' class name.', function( assert ) {
    300300                var done = assert.async();
    301301
     
    317317    // Check connecting to a second URL.
    318318    wp.api.loadPromise.done( function() {
    319         QUnit.test( 'Checking connecting to a remote url.' , function( assert ) {
     319        QUnit.test( 'Checking connecting to a remote url.', function( assert ) {
    320320            var done = assert.async();
    321321
Note: See TracChangeset for help on using the changeset viewer.