generated from nhcarrigan/template
feat: initial commit
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
import { assert } from "chai";
|
||||
|
||||
import { inarikoSeasons } from "../src/data/weather/regions/inarikoSeasons";
|
||||
import { rudaniaSeasons } from "../src/data/weather/regions/rudaniaSeasons";
|
||||
import { vhintlSeasons } from "../src/data/weather/regions/vhintlSeasons";
|
||||
|
||||
suite("Region Tests", () => {
|
||||
suite("Inariko", () => {
|
||||
test("Seasons should be unique", () => {
|
||||
const seasons = new Set(inarikoSeasons.map((el) => el.season));
|
||||
assert.equal(
|
||||
seasons.size,
|
||||
inarikoSeasons.length,
|
||||
"seasons are not unique!"
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of inarikoSeasons) {
|
||||
test(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
assert.equal(
|
||||
temps.size,
|
||||
season.temps.length,
|
||||
`${season.season} temps are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
assert.equal(
|
||||
winds.size,
|
||||
season.wind.length,
|
||||
`${season.season} winds are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
assert.equal(
|
||||
precipitation.size,
|
||||
season.precipitation.length,
|
||||
`${season.season} precipitation is not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
assert.equal(
|
||||
specials.size,
|
||||
season.special.length,
|
||||
`${season.season} specials are not unique!`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
suite("Rudania", () => {
|
||||
test("Seasons should be unique", () => {
|
||||
const seasons = new Set(rudaniaSeasons.map((el) => el.season));
|
||||
assert.equal(
|
||||
seasons.size,
|
||||
rudaniaSeasons.length,
|
||||
"seasons are not unique!"
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of rudaniaSeasons) {
|
||||
test(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
assert.equal(
|
||||
temps.size,
|
||||
season.temps.length,
|
||||
`${season.season} temps are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
assert.equal(
|
||||
winds.size,
|
||||
season.wind.length,
|
||||
`${season.season} winds are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
assert.equal(
|
||||
precipitation.size,
|
||||
season.precipitation.length,
|
||||
`${season.season} precipitation is not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
assert.equal(
|
||||
specials.size,
|
||||
season.special.length,
|
||||
`${season.season} specials are not unique!`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
suite("Vhintl", () => {
|
||||
test("Seasons should be unique", () => {
|
||||
const seasons = new Set(vhintlSeasons.map((el) => el.season));
|
||||
assert.equal(
|
||||
seasons.size,
|
||||
vhintlSeasons.length,
|
||||
"seasons are not unique!"
|
||||
);
|
||||
});
|
||||
|
||||
for (const season of vhintlSeasons) {
|
||||
test(`${season.season} should have unique temps`, () => {
|
||||
const temps = new Set(season.temps);
|
||||
assert.equal(
|
||||
temps.size,
|
||||
season.temps.length,
|
||||
`${season.season} temps are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique winds`, () => {
|
||||
const winds = new Set(season.wind);
|
||||
assert.equal(
|
||||
winds.size,
|
||||
season.wind.length,
|
||||
`${season.season} winds are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique precipitation`, () => {
|
||||
const precipitation = new Set(season.precipitation);
|
||||
assert.equal(
|
||||
precipitation.size,
|
||||
season.precipitation.length,
|
||||
`${season.season} precipitation is not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${season.season} should have unique specials`, () => {
|
||||
const specials = new Set(season.special);
|
||||
assert.equal(
|
||||
specials.size,
|
||||
season.special.length,
|
||||
`${season.season} specials are not unique!`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,108 @@
|
||||
import { assert } from "chai";
|
||||
|
||||
import { precipitations } from "../src/data/weather/precipitations";
|
||||
import { specials } from "../src/data/weather/specials";
|
||||
import { temperatures } from "../src/data/weather/temperatures";
|
||||
import { winds } from "../src/data/weather/winds";
|
||||
|
||||
suite("Weather Tests", () => {
|
||||
suite("Temperature", () => {
|
||||
const temps = new Set(temperatures.map((el) => el.name));
|
||||
test("Temperatures should be unique", () => {
|
||||
assert.equal(
|
||||
temps.size,
|
||||
temperatures.length,
|
||||
"temperatures are not unique!"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
suite("Winds", () => {
|
||||
const wind = new Set(winds.map((el) => el.name));
|
||||
test("Winds should be unique", () => {
|
||||
assert.equal(wind.size, winds.length, "winds are not unique!");
|
||||
});
|
||||
});
|
||||
|
||||
suite("Precipitations", () => {
|
||||
const precip = new Set(precipitations.map((el) => el.name));
|
||||
test("Precipitations should be unique", () => {
|
||||
assert.equal(
|
||||
precip.size,
|
||||
precipitations.length,
|
||||
"precipitations are not unique!"
|
||||
);
|
||||
});
|
||||
|
||||
for (const precipitation of precipitations) {
|
||||
test(`${precipitation.name} should have unique temps`, () => {
|
||||
if (precipitation.temps === "any") {
|
||||
return;
|
||||
}
|
||||
const temps = new Set(precipitation.temps);
|
||||
assert.equal(
|
||||
temps.size,
|
||||
precipitation.temps.length,
|
||||
`${precipitation.name} temps are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${precipitation.name} should have unique winds`, () => {
|
||||
if (precipitation.winds === "any") {
|
||||
return;
|
||||
}
|
||||
const winds = new Set(precipitation.winds);
|
||||
assert.equal(
|
||||
winds.size,
|
||||
precipitation.winds.length,
|
||||
`${precipitation.name} winds are not unique!`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
suite("Specials", () => {
|
||||
const spec = new Set(specials.map((el) => el.name));
|
||||
test("Specials should be unique", () => {
|
||||
assert.equal(spec.size, specials.length, "specials are not unique!");
|
||||
});
|
||||
|
||||
for (const special of specials) {
|
||||
test(`${special.name} should have unique temps`, () => {
|
||||
if (special.temps === "any") {
|
||||
return;
|
||||
}
|
||||
const temps = new Set(special.temps);
|
||||
assert.equal(
|
||||
temps.size,
|
||||
special.temps.length,
|
||||
`${special.name} temps are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${special.name} should have unique winds`, () => {
|
||||
if (special.winds === "any") {
|
||||
return;
|
||||
}
|
||||
const winds = new Set(special.winds);
|
||||
assert.equal(
|
||||
winds.size,
|
||||
special.winds.length,
|
||||
`${special.name} winds are not unique!`
|
||||
);
|
||||
});
|
||||
|
||||
test(`${special.name} should have unique precipitation`, () => {
|
||||
if (special.precipitations === "any") {
|
||||
return;
|
||||
}
|
||||
const precip = new Set(special.precipitations);
|
||||
assert.equal(
|
||||
precip.size,
|
||||
special.precipitations.length,
|
||||
`${special.name} precipitation is not unique!`
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user