-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests.html
More file actions
42 lines (38 loc) · 1.08 KB
/
tests.html
File metadata and controls
42 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" media="screen" />
<script src="http://code.jquery.com/qunit/git/qunit.js"></script>
<script src="jquery.pluginloader.js"></script>
<script>
var iWasCalled = false;
$.fn.initPlugin = function(options) {
iWasCalled = true;
};
$(function(){
test("is plugin called on load", function() {
ok(iWasCalled, "Plugin was called");
});
asyncTest("a basic test example", function() {
$.fn.testPlugin = function(options) {
equal(options.name, "thorsteinsson");
equal(options.foo.bar, 1337);
start();
};
$('<div data-plugin="testPlugin: {name: \'thorsteinsson\', foo: { bar: 1337 }}" />').loadPlugins();
});
});
</script>
</head>
<body>
<h1 id="qunit-header">jQuery Plugin Loader</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">
<div data-plugin="initPlugin" />
</div>
</body>
</html>