test: set up Deno version test cases

This commit is contained in:
Birame Sene authored and Peter Kofler committed 2025-01-22 18:36:51 +01:00
1 parent f86e41151c
commit 3690af35f9
4 files changed
+55 -18

No files matched your search

+23 -15
View File
@@ -3,7 +3,7 @@ export class Item {
sellIn: number;
quality: number;
constructor(name, sellIn, quality) {
constructor(name: string, sellIn: number, quality: number) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
@@ -19,46 +19,54 @@ export class GildedRose {
updateQuality() {
for (let i = 0; i < this.items.length; i++) {
if (this.items[i].name != 'Aged Brie' && this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (
this.items[i].name != "Aged Brie" &&
this.items[i].name != "Backstage passes to a TAFKAL80ETC concert"
) {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
if (this.items[i].name != "Sulfuras, Hand of Ragnaros") {
this.items[i].quality = this.items[i].quality - 1;
}
}
} else {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
if (this.items[i].name == 'Backstage passes to a TAFKAL80ETC concert') {
this.items[i].quality = this.items[i].quality + 1;
if (
this.items[i].name == "Backstage passes to a TAFKAL80ETC concert"
) {
if (this.items[i].sellIn < 11) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
this.items[i].quality = this.items[i].quality + 1;
}
}
if (this.items[i].sellIn < 6) {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
this.items[i].quality = this.items[i].quality + 1;
}
}
}
}
}
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
if (this.items[i].name != "Sulfuras, Hand of Ragnaros") {
this.items[i].sellIn = this.items[i].sellIn - 1;
}
if (this.items[i].sellIn < 0) {
if (this.items[i].name != 'Aged Brie') {
if (this.items[i].name != 'Backstage passes to a TAFKAL80ETC concert') {
if (this.items[i].name != "Aged Brie") {
if (
this.items[i].name != "Backstage passes to a TAFKAL80ETC concert"
) {
if (this.items[i].quality > 0) {
if (this.items[i].name != 'Sulfuras, Hand of Ragnaros') {
this.items[i].quality = this.items[i].quality - 1
if (this.items[i].name != "Sulfuras, Hand of Ragnaros") {
this.items[i].quality = this.items[i].quality - 1;
}
}
} else {
this.items[i].quality = this.items[i].quality - this.items[i].quality
this.items[i].quality = this.items[i].quality -
this.items[i].quality;
}
} else {
if (this.items[i].quality < 50) {
this.items[i].quality = this.items[i].quality + 1
this.items[i].quality = this.items[i].quality + 1;
}
}
}