Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tadatuta committed Mar 16, 2017
1 parent 9295d19 commit b9f9002
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/init-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,16 @@ describe('oninit', function() {
}
}, '[4.[3.[0.<div class="b1">][2.[1.<div class="b2">]</div>]</div>]]');
});

it('should use global object as `this`', function () {
test(function() {
oninit(function() {
this._something = { blah: 42 };
});
block('b1').replace()(function() {
/* global _something */
return _something.blah;
});
}, { block: 'b1' }, '42');
});
});

0 comments on commit b9f9002

Please sign in to comment.