Skip to content

Commit

Permalink
Made (basic) test cover two-way data-binding.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrhodes committed Nov 7, 2013
1 parent 1e2b26d commit 9b1ebdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "observe-stream",
"version": "0.0.3",
"version": "0.0.4",
"description": "A browser mixin that lets you update and observe changes to Object properties using streams.",
"main": "index.js",
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion test/index.js
Expand Up @@ -3,6 +3,8 @@ var stream = require('stream-mixin')
var observe = require('../')

run('it works', function(test) {
test.plan(2)

var model = { key: 'value' }
var input = document.createElement('input')
input.type = 'checkbox'
Expand All @@ -21,7 +23,8 @@ run('it works', function(test) {

input.onclick = function() {
test.equal(input.value, 'new value')
test.end()
input.emit('data', { key: 'newer value' })
test.equal(model.key, 'newer value')
}

model.key = 'new value'
Expand Down

0 comments on commit 9b1ebdd

Please sign in to comment.