forked from jsdoc/jsdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,61 @@ | ||
describe("var statements", function() { | ||
var docSet = jasmine.getDocSetFromFile('test/fixtures/var.js'), | ||
found = [ | ||
docSet.getByLongname('GREEN'), | ||
docSet.getByLongname('RED'), | ||
docSet.getByLongname('validate'), | ||
docSet.getByLongname('i'), | ||
docSet.getByLongname('results') | ||
]; | ||
/*global describe, expect, it, jasmine */ | ||
'use strict'; | ||
|
||
describe("when a series of constants are documented", function() { | ||
it("should find the first constant", function() { | ||
expect(found[0].length).toEqual(1); | ||
describe('var statements', function() { | ||
var docSet = jasmine.getDocSetFromFile('test/fixtures/var.js'); | ||
var found = [ | ||
docSet.getByLongname('GREEN'), | ||
docSet.getByLongname('RED'), | ||
docSet.getByLongname('validate'), | ||
docSet.getByLongname('i'), | ||
docSet.getByLongname('results') | ||
]; | ||
|
||
describe('when a series of constants is documented', function() { | ||
it('should find the first constant', function() { | ||
expect(found[0].length).toBe(1); | ||
}); | ||
|
||
it("attach the docs to the first constant", function() { | ||
expect(found[0][0].comment).toEqual('/** document me */'); | ||
it('should attach the docs to the first constant', function() { | ||
expect(found[0][0].comment).toBe('/** document me */'); | ||
}); | ||
|
||
it("should have a correct short name", function() { | ||
expect(found[0][0].name).toEqual('GREEN'); | ||
it('should have the correct name', function() { | ||
expect(found[0][0].name).toBe('GREEN'); | ||
}); | ||
|
||
it("should have a correct memberof", function() { | ||
it('should have the correct memberof', function() { | ||
expect(found[0][0].memberof).toBeUndefined(); | ||
}); | ||
|
||
it("should give the constant a global scope", function() { | ||
expect(found[0][0].scope).toEqual('global'); | ||
it('should give the constant a global scope', function() { | ||
expect(found[0][0].scope).toBe('global'); | ||
}); | ||
|
||
it("should find the second constant", function() { | ||
expect(found[1].length).toEqual(1); | ||
it('should find the second constant', function() { | ||
expect(found[1].length).toBe(1); | ||
}); | ||
|
||
it("should not attach the docs to the second constant", function() { | ||
expect(found[1][0].undocumented).toEqual(true); | ||
it('should not attach the docs to the second constant', function() { | ||
expect(found[1][0].undocumented).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('When a member of a series of vars are documented.', function() { | ||
it("should attach the docs to the correct var", function() { | ||
expect(found[4][0].comment).toEqual('/** document me */'); | ||
describe('when a member of a series of vars is documented', function() { | ||
it('should attach the docs to the correct var', function() { | ||
expect(found[4][0].comment).toBe('/** document me */'); | ||
}); | ||
|
||
it("should hav a correct short name", function() { | ||
expect(found[4][0].name).toEqual('results'); | ||
it('should have the correct name', function() { | ||
expect(found[4][0].name).toBe('results'); | ||
}); | ||
|
||
it("should leave memberof undefined", function() { | ||
it('should leave memberof undefined', function() { | ||
expect(found[4][0].memberof).toBeUndefined(); | ||
}); | ||
|
||
it("should give the var a global scope", function() { | ||
expect(found[4][0].scope).toEqual('global'); | ||
it('should give the var a global scope', function() { | ||
expect(found[4][0].scope).toBe('global'); | ||
}); | ||
}); | ||
}); | ||
}); |