-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgreenify-test.js
28 lines (28 loc) · 981 Bytes
/
greenify-test.js
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
// LICENSE : MIT
"use strict";
import jsdom from "jsdom";
import assert from "power-assert";
import fs from "fs";
const testbed = fs.readFileSync(__dirname + "/fixtures/testbed.html", "utf-8");
const jquery = fs.readFileSync(__dirname + "/../../node_modules/jquery/dist/jquery.js", "utf-8");
const greenify = fs.readFileSync(__dirname + "/../../src/jQuery/greenify.js", "utf-8");
describe("greenify", function () {
let $, document;
before(done => {
jsdom.env({
html: testbed,
src: [jquery, greenify],
done: function (err, window) {
document = window.document;
$ = window.$;
done();
}
});
});
it("should extend $.prototype with greenify", function () {
assert(typeof $ !== "undefined");
assert($.fn.greenify != null);
assert($(document.body).greenify != null);
assert($(document.body).greenify() instanceof $);
});
});