File tree 6 files changed +74
-7
lines changed 6 files changed +74
-7
lines changed Original file line number Diff line number Diff line change @@ -35,3 +35,6 @@ jspm_packages
35
35
36
36
# Optional REPL history
37
37
.node_repl_history
38
+
39
+ # generated files
40
+ index.js
Original file line number Diff line number Diff line change
1
+ language : node_js
2
+ node_js :
3
+ - " 6.*"
4
+
5
+ branches :
6
+ only :
7
+ - master
8
+
9
+ before_install :
10
+ npm i rollup
11
+ npm run build
12
+
13
+ notifications :
14
+ email : false
15
+
16
+ sudo : false
Original file line number Diff line number Diff line change 1
1
# bianco-query
2
- Modern DOM query selectors helpers written in es2015
3
2
4
- This script will not be transpiled and it is only thought to be part of your build chain.
3
+ [ ![ Build Status] [ travis-image ]] [ travis-url ]
4
+
5
+ [ ![ NPM version] [ npm-version-image ]] [ npm-url ]
6
+ [ ![ NPM downloads] [ npm-downloads-image ]] [ npm-url ]
7
+ [ ![ MIT License] [ license-image ]] [ license-url ]
8
+
9
+ Modern DOM query selectors helpers written in es2015
5
10
6
11
## Usage
7
12
@@ -14,3 +19,14 @@ $('h1').forEach((h1) => console.log(h1.innerHTML))
14
19
## API
15
20
16
21
- ` $(selector|NodeList, context) ` returns always an array of the elements found
22
+
23
+
24
+ [ travis-image ] :https://img.shields.io/travis/GianlucaGuarini/bianco-query.svg?style=flat-square
25
+ [ travis-url ] :https://travis-ci.org/GianlucaGuarini/bianco-query
26
+
27
+ [ license-image ] :http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
28
+ [ license-url ] :LICENSE.txt
29
+
30
+ [ npm-version-image ] :http://img.shields.io/npm/v/bianco-query.svg?style=flat-square
31
+ [ npm-downloads-image ] :http://img.shields.io/npm/dm/bianco-query.svg?style=flat-square
32
+ [ npm-url ] :https://npmjs.org/package/bianco-query
File renamed without changes.
Original file line number Diff line number Diff line change 3
3
"version" : " 0.0.0" ,
4
4
"description" : " Modern DOM query selectors helpers written in es2015" ,
5
5
"main" : " index.js" ,
6
- "jsnext:main" : " index.js" ,
6
+ "jsnext:main" : " index.next. js" ,
7
7
"scripts" : {
8
- "prepublish" : " npm test" ,
9
- "test" : " echo 'there will be soon'"
8
+ "prepublish" : " npm run build && npm test" ,
9
+ "build" : " rollup -f cjs -- index.next.js > index.js" ,
10
+ "test" : " node test"
10
11
},
11
12
"files" : [
12
- " index.js"
13
+ " index.js" ,
14
+ " index.next.js"
13
15
],
14
16
"repository" : {
15
17
"type" : " git" ,
29
31
"bugs" : {
30
32
"url" : " https://github.com/GianlucaGuarini/bianco-query/issues"
31
33
},
32
- "homepage" : " https://github.com/GianlucaGuarini/bianco-query#readme"
34
+ "homepage" : " https://github.com/GianlucaGuarini/bianco-query#readme" ,
35
+ "devDependencies" : {
36
+ "jsdom" : " 9.5.0" ,
37
+ "jsdom-global" : " 2.1.0"
38
+ }
33
39
}
Original file line number Diff line number Diff line change
1
+ require ( 'jsdom-global' ) ( )
2
+ const assert = require ( 'assert' )
3
+ const $ = require ( './' )
4
+
5
+ function setup ( ) {
6
+ var div = document . createElement ( 'div' )
7
+
8
+ div . innerHTML = `
9
+ <ul>
10
+ <li class='item'></li>
11
+ <li class='item'></li>
12
+ </ul>
13
+ `
14
+ document . body . appendChild ( div )
15
+ }
16
+
17
+ setup ( )
18
+
19
+ const div = $ ( 'div' )
20
+ assert . equal ( typeof div , 'object' )
21
+ assert . equal ( div . length , 1 )
22
+
23
+ assert . equal ( $ ( '.item' , div [ 0 ] ) . length , 2 )
24
+
25
+
26
+
You can’t perform that action at this time.
0 commit comments