mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 06:20:38 -07:00
feature: strict_variables, working on #9
This commit is contained in:
@@ -18,6 +18,24 @@ describe('scope', function() {
|
||||
scope.get('foo').should.equal('bar');
|
||||
});
|
||||
|
||||
it('should get undefined property', function() {
|
||||
function fn(){
|
||||
scope.get('notdefined');
|
||||
}
|
||||
expect(fn).to.not.throw();
|
||||
expect(scope.get('notdefined')).to.equal(undefined);
|
||||
});
|
||||
|
||||
it('should throw undefined in strict mode', function() {
|
||||
scope = Scope.factory(ctx, {
|
||||
strict: true
|
||||
});
|
||||
function fn(){
|
||||
scope.get('notdefined');
|
||||
}
|
||||
expect(fn).to.throw(/undefined variable: notdefined/);
|
||||
});
|
||||
|
||||
it('should get all property', function() {
|
||||
scope.get().should.deep.equal(ctx);
|
||||
expect(scope.get('')).to.equal(undefined);
|
||||
|
||||
Reference in New Issue
Block a user