mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Fix linting issues
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
// eslint-disable-next-line max-len
|
||||
import { getAllScheduleMatchingGroups } from '../../website/common/script/content/constants/schedule';
|
||||
|
||||
function validateMatcher(matcher, checkedDate) {
|
||||
function validateMatcher (matcher, checkedDate) {
|
||||
expect(matcher.end).to.be.a('date');
|
||||
expect(matcher.end).to.be.greaterThan(checkedDate);
|
||||
}
|
||||
@@ -15,15 +15,19 @@ describe('Content Schedule', () => {
|
||||
const date = new Date('2024-01-15');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on january 31th', () => {
|
||||
const date = new Date('2024-01-31')
|
||||
const date = new Date('2024-01-31');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,7 +35,9 @@ describe('Content Schedule', () => {
|
||||
const date = new Date('2024-03-02');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -39,22 +45,28 @@ describe('Content Schedule', () => {
|
||||
const date = new Date('2024-03-21');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('assembles scheduled items on october 7th', () => {
|
||||
const date = new Date('2024-10-07')
|
||||
const date = new Date('2024-10-07');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
it('assembles scheduled items on november 1th', () => {
|
||||
const date = new Date('2024-11-01');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -62,7 +74,9 @@ describe('Content Schedule', () => {
|
||||
const date = new Date('2024-12-20');
|
||||
const matchers = getAllScheduleMatchingGroups(date);
|
||||
for (const key in matchers) {
|
||||
validateMatcher(matchers[key], date);
|
||||
if (matchers[key]) {
|
||||
validateMatcher(matchers[key], date);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user