Skip to content

Commit 060600d

Browse files
committed
Passing tests
1 parent 9e124b3 commit 060600d

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,32 @@
44
"description": "Cross browser Element#hidden",
55
"keywords": [],
66
"author": "Raynos <raynos2@gmail.com>",
7-
"repository": "git://github.com/Colingo/hidden.git",
7+
"repository": "git://github.com/npm-dom/hidden.git",
88
"main": "index",
9-
"homepage": "https://github.com/Colingo/hidden",
9+
"homepage": "https://github.com/npm-dom/hidden",
1010
"contributors": [
1111
{
1212
"name": "Raynos"
1313
}
1414
],
1515
"bugs": {
16-
"url": "https://github.com/Colingo/hidden/issues",
16+
"url": "https://github.com/npm-dom/hidden/issues",
1717
"email": "raynos2@gmail.com"
1818
},
1919
"dependencies": {},
2020
"devDependencies": {
21-
"tap": "~0.3.1",
22-
"browserify-server": "~2.1.10"
21+
"browserify": "13.0.0",
22+
"domify": "1.4.0",
23+
"tape": "4.5.1",
24+
"tape-run": "2.1.3"
2325
},
2426
"licenses": [
2527
{
2628
"type": "MIT",
27-
"url": "http://github.com/Colingo/hidden/raw/master/LICENSE"
29+
"url": "http://github.com/npm-dom/hidden/raw/master/LICENSE"
2830
}
2931
],
3032
"scripts": {
31-
"test": "tap ./test"
33+
"test": "browserify test.js | tape-run"
3234
}
3335
}

test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var test = require('tape')
2+
var domify = require('domify')
3+
var hidden = require('./')
4+
5+
test('Returns true/false when an element is hidden/not', function(t) {
6+
var el = domify('<div>eh wut wut</div>')
7+
8+
t.notOk(hidden(el))
9+
10+
el.style.display = 'none'
11+
t.ok(hidden(el))
12+
13+
t.end()
14+
})
15+
16+
test('Sets an element\'s hiddenness', function(t) {
17+
var el = domify('<div>o hai</div>')
18+
19+
t.notOk(hidden(el))
20+
21+
hidden(el, true)
22+
t.ok(hidden(el))
23+
24+
hidden(el, false)
25+
t.notOk(hidden(el))
26+
27+
t.end()
28+
})

0 commit comments

Comments
 (0)