Skip to content

Commit

Permalink
use real d3 for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pemrouz committed Jul 2, 2015
1 parent 0c1a789 commit f0001c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"devDependencies": {
"chai": "^2.3.0",
"coveralls": "^2.11.2",
"d3": "^3.5.5",
"istanbul": "^0.3.13",
"mocha": "^2.2.4",
"mocha-lcov-reporter": "0.0.2"
Expand Down
17 changes: 3 additions & 14 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var expect = require('chai').expect
, d3 = global.d3 = mock()
, d3 = global.d3 = require('d3')
, from = require('./')

describe('from', function() {
Expand All @@ -10,19 +10,8 @@ describe('from', function() {
})

it('should resolve from parent data', function() {
expect(from.parent.call({}, 'foo')).to.be.eql('bar')
var o = { parentNode: { __data__: { foo: 'bar' } } }
expect(from.parent.call(o, 'foo')).to.be.eql('bar')
})

})

function mock() {
return { select: select }

function select() {
return { datum: datum }
}

function datum() {
return { foo: 'bar' }
}
}

0 comments on commit f0001c9

Please sign in to comment.