Skip to content

Commit

Permalink
test(id): Adding test for id getter
Browse files Browse the repository at this point in the history
Changing the id property from a function to a getter. Also testing persistence
on multiple instantiations.
  • Loading branch information
nathanstilwell committed Nov 21, 2015
1 parent 5976af2 commit 5f2787c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/specs/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ var test = require('tape')
var Hoodie = require('../../index')

test('has "id" method', function (t) {
t.plan(1)
var firstHoodie = new Hoodie()
var secondHoodie = new Hoodie()
t.is(typeof firstHoodie.id, 'string', 'has id getter property')
t.is(typeof secondHoodie.id, 'string', 'has id getter property')
t.is(firstHoodie.id, secondHoodie.id, 'id persists upon multiple instantiations')

var hoodie = new Hoodie()
t.is(typeof hoodie.id, 'function', 'has method')
t.end()
})

0 comments on commit 5f2787c

Please sign in to comment.