generated from nhcarrigan/template
feat: update this highly outdated app to use latest packages and custom configs (#1)
Reviewed-on: https://codeberg.org/nhcarrigan/tingle-bot/pulls/1 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
132
test/regions.spec.ts
Normal file
132
test/regions.spec.ts
Normal file
@ -0,0 +1,132 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { inarikoSeasons } from "../src/data/weather/regions/inarikoSeasons.ts";
|
||||
import { rudaniaSeasons } from "../src/data/weather/regions/rudaniaSeasons.ts";
|
||||
import { vhintlSeasons } from "../src/data/weather/regions/vhintlSeasons.ts";
|
||||
|
||||
describe("region Tests", () => {
|
||||
describe("inariko", () => {
|
||||
it("seasons should be unique", () => {
|
||||
const seasons = new Set(inarikoSeasons.map((element) => {
|
||||
return element.season;
|
||||
}));
|
||||
expect(seasons.size, "seasons are not unique!").toBe(
|
||||
inarikoSeasons.length,
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of inarikoSeasons) {
|
||||
it(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
expect(temps.size, `${season.season} temps are not unique!`).toBe(
|
||||
season.temps.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
expect(winds.size, `${season.season} winds are not unique!`).toBe(
|
||||
season.wind.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
expect(
|
||||
precipitation.size,
|
||||
`${season.season} precipitation is not unique!`,
|
||||
).toBe(season.precipitation.length);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
expect(specials.size, `${season.season} specials are not unique!`).toBe(
|
||||
season.special.length,
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("rudania", () => {
|
||||
it("seasons should be unique", () => {
|
||||
const seasons = new Set(rudaniaSeasons.map((element) => {
|
||||
return element.season;
|
||||
}));
|
||||
expect(seasons.size, "seasons are not unique!").toBe(
|
||||
rudaniaSeasons.length,
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of rudaniaSeasons) {
|
||||
it(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
expect(temps.size, `${season.season} temps are not unique!`).toBe(
|
||||
season.temps.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
expect(winds.size, `${season.season} winds are not unique!`).toBe(
|
||||
season.wind.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
expect(
|
||||
precipitation.size,
|
||||
`${season.season} precipitation is not unique!`,
|
||||
).toBe(season.precipitation.length);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
expect(specials.size, `${season.season} specials are not unique!`).toBe(
|
||||
season.special.length,
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe("vhintl", () => {
|
||||
it("seasons should be unique", () => {
|
||||
const seasons = new Set(vhintlSeasons.map((element) => {
|
||||
return element.season;
|
||||
}));
|
||||
expect(seasons.size, "seasons are not unique!").toBe(
|
||||
vhintlSeasons.length,
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of vhintlSeasons) {
|
||||
it(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
expect(temps.size, `${season.season} temps are not unique!`).toBe(
|
||||
season.temps.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
expect(winds.size, `${season.season} winds are not unique!`).toBe(
|
||||
season.wind.length,
|
||||
);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
expect(
|
||||
precipitation.size,
|
||||
`${season.season} precipitation is not unique!`,
|
||||
).toBe(season.precipitation.length);
|
||||
});
|
||||
|
||||
it(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
expect(specials.size, `${season.season} specials are not unique!`).toBe(
|
||||
season.special.length,
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user