File tree 7 files changed +53
-25
lines changed
7 files changed +53
-25
lines changed Original file line number Diff line number Diff line change 33
33
"devDependencies" : {
34
34
"eslint" : " ^1.3.0" ,
35
35
"eslint-plugin-markdown" : " git://github.com/eslint/eslint-plugin-markdown.git" ,
36
+ "espower-babel" : " ^3.3.0" ,
36
37
"gitbook-cli" : " ^0.3.4" ,
37
38
"gitbook-summary-to-path" : " ^1.0.1" ,
39
+ "jsdom" : " ^3.0.0" ,
40
+ "mocha" : " ^2.2.5" ,
41
+ "power-assert" : " ^1.0.0" ,
38
42
"textlint" : " ^3.2.0" ,
39
43
"textlint-rule-spellcheck-tech-word" : " ^4.0.1"
44
+ },
45
+ "dependencies" : {
46
+ "jquery" : " ^2.1.4"
40
47
}
41
48
}
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+ ( function ( $ ) {
3
+ $ . fn . greenify = function ( ) {
4
+ this . css ( "color" , "green" ) ;
5
+ return this ;
6
+ } ;
7
+ } ) ( jQuery ) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > </ title >
6
+ </ head >
7
+ < body >
8
+
9
+ </ body >
10
+ </ html >
Original file line number Diff line number Diff line change
1
+ // LICENSE : MIT
2
+ "use strict" ;
3
+ import jsdom from "jsdom" ;
4
+ import assert from "power-assert"
5
+ import fs from "fs" ;
6
+ const testbed = fs . readFileSync ( __dirname + "/fixtures/testbed.html" , "utf-8" ) ;
7
+ const jquery = fs . readFileSync ( __dirname + "/../../node_modules/jquery/dist/jquery.js" , "utf-8" ) ;
8
+ const greenify = fs . readFileSync ( __dirname + "/../../src/jQuery/greenify.js" , "utf-8" ) ;
9
+ describe ( "greenify" , function ( ) {
10
+ var $ , document ;
11
+ before ( done => {
12
+ jsdom . env ( {
13
+ html : testbed ,
14
+ src : [ jquery , greenify ] ,
15
+ done : function ( err , window ) {
16
+ document = window . document ;
17
+ $ = window . $ ;
18
+ done ( ) ;
19
+ }
20
+ } ) ;
21
+ } ) ;
22
+ it ( "should extend $.prototype with greenify" , function ( ) {
23
+ assert ( typeof $ !== "undefined" ) ;
24
+ assert ( $ . fn . greenify != null ) ;
25
+ assert ( $ ( document . body ) . greenify != null ) ;
26
+ assert ( $ ( document . body ) . greenify ( ) instanceof $ ) ;
27
+ } ) ;
28
+ } ) ;
Original file line number Diff line number Diff line change
1
+ --compilers js:espower-babel/guess
You can’t perform that action at this time.
0 commit comments