Skip to content

Commit

Permalink
add tests for all valid ending punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
callum-marshall committed Oct 26, 2020
1 parent 9c96a72 commit 181ed5d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/methods/schema/validate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,52 @@ describe('Generate input schemas', () => {
expect(consoleTableOutput).toEqual([]);
});

test('It should not log if the description ends with a full stop.', () => {
generateInputSchema({
schema: fullSchema,
keys: {
full_stop: {
type: 'string',
description: 'full stop.',
},
},
operation: 'validateFullStop',
});
expect(consoleWarnOutput).toEqual([]);
expect(consoleTableOutput).toEqual([]);
});

test('It should not log if the description ends with a question mark.', () => {
generateInputSchema({
schema: fullSchema,
keys: {
question_mark: {
type: 'string',
description: 'question mark?',
},
},
operation: 'validateQuestionMark',
});
expect(consoleWarnOutput).toEqual([]);
expect(consoleTableOutput).toEqual([]);
});

test('It should not log if the description ends with an exclamation mark.', () => {
generateInputSchema({
schema: fullSchema,
keys: {
exclamation_mark: {
type: 'string',
description: 'exclamation mark!',
},
},
operation: 'validateExclamationMark',
});
expect(consoleWarnOutput).toEqual([]);
expect(consoleTableOutput).toEqual([]);
});


test('It should log all issue in full schema.', () => {
generateInputSchema({
schema: fullSchema,
Expand Down

0 comments on commit 181ed5d

Please sign in to comment.