Skip to content

Commit

Permalink
Add test for didYouMean with sub-message (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored and IvanGoncharov committed Jun 25, 2019
1 parent a9a21f3 commit b904859
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/jsutils/__tests__/didYouMean-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ describe('didYouMean', () => {
expect(didYouMean([])).to.equal('');
});

it('Handle single suggestion', () => {
it('Handles single suggestion', () => {
expect(didYouMean(['A'])).to.equal(' Did you mean A?');
});

it('Handle two suggestions', () => {
it('Handles two suggestions', () => {
expect(didYouMean(['A', 'B'])).to.equal(' Did you mean A or B?');
});

it('Handle multiple suggestions', () => {
it('Handles multiple suggestions', () => {
expect(didYouMean(['A', 'B', 'C'])).to.equal(' Did you mean A, B, or C?');
});

Expand All @@ -26,4 +26,10 @@ describe('didYouMean', () => {
' Did you mean A, B, C, D, or E?',
);
});

it('Adds sub-message', () => {
expect(didYouMean('the letter', ['A'])).to.equal(
' Did you mean the letter A?',
);
});
});

0 comments on commit b904859

Please sign in to comment.