Skip to content

Commit

Permalink
Quell some SonarCloud code smell warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jun 2, 2024
1 parent b102a9b commit 9b00d6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/hebcal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
import '../src/locale'; // Adds Hebrew and Ashkenazic translations
import {CalOptions} from './CalOptions';
import {version as pkgVersion} from './pkgVersion';
import {Sedra} from './sedra';
import {DailyLearning} from './DailyLearning';
import {HebrewDateEvent} from './HebrewDateEvent';
import {ParshaEvent} from './ParshaEvent';
Expand All @@ -37,7 +36,7 @@ import {
} from './candles';
import {TimedEvent, HavdalahEvent} from './TimedEvent';
import {Event, flags} from './event';
import {getSedra_} from './sedra';
import {Sedra, getSedra_} from './sedra';
import {hallel_} from './hallel';
import {getHolidaysForYear_, HolidayYearMap} from './holidays';
import {MevarchimChodeshEvent} from './MevarchimChodeshEvent';
Expand Down
2 changes: 1 addition & 1 deletion src/sedra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class Sedra {
const index = this.theSedraArray[weekNum];

if (typeof index === 'undefined') {
const sedra = new Sedra(this.year + 1, this.il);
const sedra = getSedra_(this.year + 1, this.il);
return sedra.lookup(saturday); // must be next year
}
if (typeof index === 'string') {
Expand Down
9 changes: 6 additions & 3 deletions test/location.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@ test('shortName-DC', () => {

test('throws', () => {
expect(() => {
new Location(100, 123.0, false, 'UTC', 'Foo', 'XX');
const location = new Location(100, 123.0, false, 'UTC', 'Foo', 'XX');
console.log(location);
}).toThrow('Latitude 100 out of range [-90,90]');

expect(() => {
new Location(37.0, -200, false, 'UTC', 'Foo', 'XX');
const location = new Location(37.0, -200, false, 'UTC', 'Foo', 'XX');
console.log(location);
}).toThrow('Longitude -200 out of range [-180,180]');

expect(() => {
new Location(NaN, -200, false, 'UTC', 'Foo', 'XX');
const location = new Location(NaN, -200, false, 'UTC', 'Foo', 'XX');
console.log(location);
}).toThrow('Latitude NaN out of range [-90,90]');
});

0 comments on commit 9b00d6d

Please sign in to comment.