Skip to content

Commit 607ad5e

Browse files
committed
Add test for unknown zone region
1 parent 5288c41 commit 607ad5e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/MomentZoneRulesProviderTest.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { expect } from 'chai';
77

8-
import { ZoneRules } from 'js-joda';
8+
import { ZoneRules, DateTimeException } from 'js-joda';
99
import { MomentZoneRules } from '../src/MomentZoneRules';
1010
import { MomentZoneRulesProvider } from '../src/MomentZoneRulesProvider';
1111

@@ -26,6 +26,11 @@ describe('MomentZoneRulesProvider', () => {
2626
zoneRules = MomentZoneRulesProvider.getRules('Etc/GMT+1');
2727
expect(zoneRules.isFixedOffset()).to.be.true;
2828
});
29+
30+
it('should throw an DateTimeException for an unknown zone region', () => {
31+
expect(() => MomentZoneRulesProvider.getRules('Atlantis'))
32+
.to.throw(DateTimeException);
33+
});
2934
});
3035

3136
context('getAvailableZoneIds', () => {

0 commit comments

Comments
 (0)