Adding specs for AnyCharacter node
This commit is contained in:
parent
8c8fbf648d
commit
94ff093824
27
spec/parser/javascript/any_character_spec.js
Normal file
27
spec/parser/javascript/any_character_spec.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import javascript from 'src/js/parser/javascript/parser.js';
|
||||||
|
|
||||||
|
describe('parser/javascript/any_character.js', function() {
|
||||||
|
|
||||||
|
it('parses "." as an AnyCharacter', function() {
|
||||||
|
var parser = new javascript.Parser('.');
|
||||||
|
expect(parser.__consume__terminal()).toEqual(jasmine.objectContaining({
|
||||||
|
type: 'any-character'
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('#_render', function() {
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
var parser = new javascript.Parser('.');
|
||||||
|
this.node = parser.__consume__terminal();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a label', function() {
|
||||||
|
spyOn(this.node, 'renderLabel').and.returnValue('rendered label');
|
||||||
|
expect(this.node._render()).toEqual('rendered label');
|
||||||
|
expect(this.node.renderLabel).toHaveBeenCalledWith('any character');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user