Skip to content

Commit 8c74e0d

Browse files
authored
Merge pull request #1295 from maxmind/horgh/period
Add tests with trailing periods
2 parents 6b0a459 + 96e138c commit 8c74e0d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/request/email.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@ describe('Email()', () => {
1212
expect(email).toThrowError('email.address');
1313
});
1414

15+
it('email.address with trailing period is not valid', () => {
16+
const email = () =>
17+
new Email({
18+
address: '[email protected].',
19+
});
20+
expect(email).toThrowError(ArgumentError);
21+
expect(email).toThrowError('email.address');
22+
});
23+
24+
it('email.address with multiple trailing periods is not valid', () => {
25+
const email = () =>
26+
new Email({
27+
address: '[email protected]...',
28+
});
29+
expect(email).toThrowError(ArgumentError);
30+
expect(email).toThrowError('email.address');
31+
});
32+
1533
it('throws an error if email.domain is not valid', () => {
1634
const email = () =>
1735
new Email({

0 commit comments

Comments
 (0)