mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
move underscore test into a div
more comfortable to include underscore with tests in some other project.
This commit is contained in:
@@ -41,7 +41,7 @@ $(document).ready(function() {
|
|||||||
var doubled = _([1, 2, 3]).map(function(num){ return num * 2; });
|
var doubled = _([1, 2, 3]).map(function(num){ return num * 2; });
|
||||||
equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers');
|
equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers');
|
||||||
|
|
||||||
var ids = _.map(document.body.childNodes, function(n){ return n.id; });
|
var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; });
|
||||||
ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists');
|
ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists');
|
||||||
|
|
||||||
var ids = _.map(document.images, function(n){ return n.id; });
|
var ids = _.map(document.images, function(n){ return n.id; });
|
||||||
|
|||||||
@@ -16,26 +16,27 @@
|
|||||||
<script type="text/javascript" src="speed.js"></script>
|
<script type="text/javascript" src="speed.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="qunit-header">Underscore Test Suite</h1>
|
<div class="underscore-test">
|
||||||
<h2 id="qunit-banner"></h2>
|
<h1 id="qunit-header">Underscore Test Suite</h1>
|
||||||
<h2 id="qunit-userAgent"></h2>
|
<h2 id="qunit-banner"></h2>
|
||||||
<ol id="qunit-tests"></ol>
|
<h2 id="qunit-userAgent"></h2>
|
||||||
<br />
|
<ol id="qunit-tests"></ol>
|
||||||
<h1 class="qunit-header">Underscore Speed Suite</h1>
|
<br />
|
||||||
<p>
|
<h1 class="qunit-header">Underscore Speed Suite</h1>
|
||||||
A representative sample of the functions are benchmarked here, to provide
|
<p>
|
||||||
a sense of how fast they might run in different browsers.
|
A representative sample of the functions are benchmarked here, to provide
|
||||||
Each iteration runs on an array of 1000 elements.<br /><br />
|
a sense of how fast they might run in different browsers.
|
||||||
For example, the 'intersect' test measures the number of times you can
|
Each iteration runs on an array of 1000 elements.<br /><br />
|
||||||
find the intersection of two thousand-element arrays in one second.
|
For example, the 'intersect' test measures the number of times you can
|
||||||
</p>
|
find the intersection of two thousand-element arrays in one second.
|
||||||
<br />
|
</p>
|
||||||
|
<br />
|
||||||
|
|
||||||
<script type="text/html" id="template">
|
<script type="text/html" id="template">
|
||||||
<%
|
<%
|
||||||
if (data) { data += 12345; }; %>
|
if (data) { data += 12345; }; %>
|
||||||
<li><%= data %></li>
|
<li><%= data %></li>
|
||||||
</script>
|
</script>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user