diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-19 11:21:24 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-19 11:21:24 -0400 |
commit | 0e8d9dde20e6bb4481fbfa94a2066125179066b0 (patch) | |
tree | 11d6f6bd515d85204c33b0d979cfcc2072461b33 | |
parent | 266cc84013c7c4d57771b2e4d0cdac3763a6764b (diff) | |
download | jquery-ui-0e8d9dde20e6bb4481fbfa94a2066125179066b0.tar.gz jquery-ui-0e8d9dde20e6bb4481fbfa94a2066125179066b0.zip |
Tests: Lint.
-rw-r--r-- | grunt.js | 9 | ||||
-rw-r--r-- | tests/unit/widget/widget_extend.js | 17 |
2 files changed, 13 insertions, 13 deletions
@@ -271,9 +271,8 @@ grunt.initConfig({ // TODO remove items from this list once rewritten return !( /(effects.core|mouse|datepicker|draggable|droppable|resizable|selectable|sortable)\.js$/ ).test( file ); }), - grunt: "grunt.js" - // TODO enabled once fixed up - // tests: "tests/unit/**/*.js" + grunt: "grunt.js", + tests: "tests/unit/**/*.js" }, csslint: { // nothing: [] @@ -343,7 +342,9 @@ grunt.initConfig({ tests: { options: extend({ browser: true, - jquery: true + jquery: true, + // TODO: this is only for document.write() + evil: true }, defaults ), // TODO: don't create so many globals in tests globals: { diff --git a/tests/unit/widget/widget_extend.js b/tests/unit/widget/widget_extend.js index 36cd999dd..ae9855929 100644 --- a/tests/unit/widget/widget_extend.js +++ b/tests/unit/widget/widget_extend.js @@ -12,7 +12,14 @@ test( "$.widget.extend()", function() { deep2copy = { foo: { baz: true }, foo2: document }, deepmerged = { foo: { bar: true, baz: true }, foo2: document }, arr = [1, 2, 3], - nestedarray = { arr: arr }; + nestedarray = { arr: arr }, + defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + options1 = { xnumber2: 1, xstring2: "x" }, + options1Copy = { xnumber2: 1, xstring2: "x" }, + options2 = { xstring2: "xx", xxx: "newstringx" }, + options2Copy = { xstring2: "xx", xxx: "newstringx" }, + merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; $.widget.extend( settings, options ); deepEqual( settings, merged, "Check if extended: settings must be extended" ); @@ -79,14 +86,6 @@ test( "$.widget.extend()", function() { $.widget.extend( obj, { foo:"notnull" } ); equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); - var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, - defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, - options1 = { xnumber2: 1, xstring2: "x" }, - options1Copy = { xnumber2: 1, xstring2: "x" }, - options2 = { xstring2: "xx", xxx: "newstringx" }, - options2Copy = { xstring2: "xx", xxx: "newstringx" }, - merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; - settings = $.widget.extend( {}, defaults, options1, options2 ); deepEqual( settings, merged2, "Check if extended: settings must be extended" ); deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); |