Skip to content

Commit

Permalink
rules: change test case wording to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Nov 18, 2014
1 parent b7dd13e commit e317b03
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 55 deletions.
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/check-param-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-param-names', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkParamNames: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkParamNames: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,7 +25,7 @@ describe('lib/rules/validate-jsdoc/check-param-names', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
Expand All @@ -37,7 +37,6 @@ describe('lib/rules/validate-jsdoc/check-param-names', function () {
function yey(yay) {
}
}

}, {
it: 'should report invalid jsdoc',
code: function () {
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/check-redundant-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-redundant-access', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkRedundantAccess: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkRedundantAccess: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/check-redundant-access', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report confusing multiaccess',
errors: 1,
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/check-redundant-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-redundant-params', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkRedundantParams: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkRedundantParams: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/check-redundant-params', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report redundant jsdoc-param for function',
errors: 1,
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/check-redundant-returns.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-redundant-returns', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkRedundantReturns: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkRedundantReturns: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/check-redundant-returns', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report redundant @returns for function',
errors: 3,
Expand Down
13 changes: 6 additions & 7 deletions test/lib/rules/validate-jsdoc/check-return-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-return-types', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkReturnTypes: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkReturnTypes: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,14 +25,13 @@ describe('lib/rules/validate-jsdoc/check-return-types', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should throw invalid type',
it: 'should report invalid type',
errors: 1,
code: function () {
/**
Expand All @@ -43,7 +42,7 @@ describe('lib/rules/validate-jsdoc/check-return-types', function () {
}
}
}, {
it: 'should neither throw nor report',
it: 'should not report',
code: function () {
/**
* @return {{a: number, b: string}}
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/check-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/check-types', function() {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({checkTypes: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({checkTypes: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/check-types', function() {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report invalid typedef',
errors: 1,
Expand Down
6 changes: 3 additions & 3 deletions test/lib/rules/validate-jsdoc/enforce-existence.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/enforce-existence', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({enforceExistence: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({enforceExistence: {}});
}).to.throws(/accepted value/i);
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/leading-underscore-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/leading-underscore-access', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({leadingUnderscoreAccess: undefined});
}).to.throws(/accepted value/i);
});

it('with object should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({leadingUnderscoreAccess: {}});
}).to.throws(/accepted value/i);
Expand All @@ -24,13 +24,12 @@ describe('lib/rules/validate-jsdoc/leading-underscore-access', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
rules: {leadingUnderscoreAccess: true},
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report enforcing @private on leading underscores',
rules: {leadingUnderscoreAccess: 'private'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/require-hyphen-before-description', function
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({requireHyphenBeforeDescription: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({requireHyphenBeforeDescription: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,7 +25,7 @@ describe('lib/rules/validate-jsdoc/require-hyphen-before-description', function
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
Expand All @@ -36,7 +36,6 @@ describe('lib/rules/validate-jsdoc/require-hyphen-before-description', function
function yey(yay) {
}
}

}, {
it: 'should report invalid description (without a hyphen)',
code: function () {
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/require-param-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/require-param-types', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({requireParamTypes: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({requireParamTypes: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/require-param-types', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report missing jsdoc-param type for function',
errors: 1,
Expand Down
9 changes: 4 additions & 5 deletions test/lib/rules/validate-jsdoc/require-return-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ describe('lib/rules/validate-jsdoc/require-return-types', function () {
additionalRules: ['lib/rules/validate-jsdoc.js']
});

describe('configured', function() {
describe('not configured', function() {

it('with undefined should throws', function() {
it('should report with undefined', function() {
global.expect(function() {
checker.configure({requireReturnTypes: undefined});
}).to.throws(/accepted value/i);
});

it('with undefined should throws', function() {
it('should report with an object', function() {
global.expect(function() {
checker.configure({requireReturnTypes: {}});
}).to.throws(/accepted value/i);
Expand All @@ -25,12 +25,11 @@ describe('lib/rules/validate-jsdoc/require-return-types', function () {
checker.cases([
/* jshint ignore:start */
{
it: 'should not throw',
it: 'should not report',
code: function() {
function yay(yey) {
}
}

}, {
it: 'should report invalid @returns',
errors: 1,
Expand Down

0 comments on commit e317b03

Please sign in to comment.