mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
switch to spyOn(console, 'log'). paramtag: fixed typo in test text
This commit is contained in:
parent
933615da86
commit
245cce8202
@ -134,8 +134,7 @@ describe("jsdoc/tag", function() {
|
||||
// further tests for this sort of thing are in jsdoc/tag/validator.js tests.
|
||||
describe("tag validating", function() {
|
||||
/*jshint evil: true */
|
||||
var lenient = !!env.opts.lenient,
|
||||
log = eval(console.log);
|
||||
var lenient = !!env.opts.lenient;
|
||||
|
||||
function badTag() {
|
||||
var tag = new jsdoc.tag.Tag("name");
|
||||
@ -144,7 +143,6 @@ describe("jsdoc/tag", function() {
|
||||
|
||||
afterEach(function() {
|
||||
env.opts.lenient = lenient;
|
||||
console.log = log;
|
||||
});
|
||||
|
||||
it("throws an exception for bad tags if the lenient option is not enabled", function() {
|
||||
@ -154,7 +152,7 @@ describe("jsdoc/tag", function() {
|
||||
});
|
||||
|
||||
it("doesn't throw an exception for bad tags if the lenient option is enabled", function() {
|
||||
console.log = function() {};
|
||||
spyOn(console, 'log');
|
||||
env.opts.lenient = true;
|
||||
|
||||
expect(badTag).not.toThrow();
|
||||
|
||||
@ -17,7 +17,6 @@ describe('jsdoc/tag/validator', function() {
|
||||
describe('validate', function() {
|
||||
var lenient = !!env.opts.lenient,
|
||||
allowUnknown = !!env.conf.tags.allowUnknownTags,
|
||||
log = eval(console.log),
|
||||
badTag = {title: 'lkjasdlkjfb'},
|
||||
meta = {filename: 'asdf.js', lineno: 1},
|
||||
goodTag = new tag.Tag('name', 'MyDocletName', meta), // mustHaveValue
|
||||
@ -28,13 +27,12 @@ describe('jsdoc/tag/validator', function() {
|
||||
}
|
||||
|
||||
beforeEach(function() {
|
||||
console.log = function() {};
|
||||
spyOn(console, 'log');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
env.opts.lenient = lenient;
|
||||
env.conf.tags.allowUnknownTags = allowUnknown;
|
||||
console.log = log;
|
||||
});
|
||||
|
||||
it("throws an error if the tag is not in the dictionary, conf.tags.allowUnknownTags is false and lenient is false", function() {
|
||||
|
||||
@ -63,7 +63,7 @@ describe("@param tag", function() {
|
||||
expect(commit.params[0].description).toBe('If true make the commit atomic.');
|
||||
});
|
||||
|
||||
it('When a symbol has a @param tag with no type but a name that indicates a default value or optional type, this infor is copied over to the params property.', function() {
|
||||
it('When a symbol has a @param tag with no type but a name that indicates a default value or optional type, this is copied over to the params property.', function() {
|
||||
expect(typeof request.params).toBe('object');
|
||||
expect(request.params.length).toBe(1);
|
||||
expect(request.params[0].type).toBeUndefined();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user