Skip to content

Commit

Permalink
update extend unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
deebloodd committed Jun 3, 2015
1 parent ed654f0 commit f1a148b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ <h1>Look In The Console</h1>
var worker = $worker().extend({
onmessage: function(e) {
console.log(e.data);
}
},
foo: true,
hello: 'world'
});

// create web worker from worker instance
Expand All @@ -25,6 +27,12 @@ <h1>Look In The Console</h1>
self.postMessage('Goodbye World');
});

worker.extend({
bar: true
});

console.log(worker1);

// Post to ALL workers in instance
worker.postMessage();
</script>
Expand Down
4 changes: 4 additions & 0 deletions spec/web-worker-extend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ describe('web-worker-extend', function() {
});

it('should extend the entire prototype', function() {
expect(myWorker.hello).toBe('world');
expect(myWorker2.hello).toBe('world');
expect(myWorker3.hello).toBe(undefined);

expect(myWorker.foo).toBe(undefined);
expect(myWorker2.foo).toBe(undefined);
expect(myWorker3.foo).toBe(undefined);
Expand Down

0 comments on commit f1a148b

Please sign in to comment.