jsdoc/test/specs/documentation/quotename.js
Jeff Williams 67244c06eb quote unsafe property names (#950)
Fixes a regression introduced by the parser overhaul in 44d9ec6831e498bd082de98a5bc60abfdba2bb7f.
2015-03-13 16:56:32 -07:00

24 lines
931 B
JavaScript

'use strict';
describe('quoted names', function() {
describe('when found in square brackets', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/quotename.js');
var found1 = docSet.getByLongname('chat.\"#channel\".open')[0];
it('should have correct name and memberof', function() {
expect(found1.name).toEqual('open');
expect(found1.memberof).toEqual('chat.\"#channel\"');
});
});
describe('when found in an object literal', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/quotename2.js');
var found1 = docSet.getByLongname('contacts."say-\\"hello\\"@example.com".username')[0];
it('should have correct name and memberof', function() {
expect(found1.name).toEqual('username');
expect(found1.memberof).toEqual('contacts."say-\\"hello\\"@example.com"');
});
});
});