mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 20:32:15 +00:00
Add a text test fixture for javascript projects
This commit is contained in:
parent
29be55f986
commit
a9ddd7f2c0
27
js-jasmine/spec/texttest_fixture.js
Normal file
27
js-jasmine/spec/texttest_fixture.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
const { Shop, Item } = require("../src/gilded_rose");
|
||||||
|
|
||||||
|
const items = [
|
||||||
|
new Item("+5 Dexterity Vest", 10, 20),
|
||||||
|
new Item("Aged Brie", 2, 0),
|
||||||
|
new Item("Elixir of the Mongoose", 5, 7),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||||
|
|
||||||
|
// This Conjured item does not work properly yet
|
||||||
|
new Item("Conjured Mana Cake", 3, 6),
|
||||||
|
];
|
||||||
|
|
||||||
|
const days = Number(process.argv[2]) || 2;
|
||||||
|
const gildedRose = new Shop(items);
|
||||||
|
|
||||||
|
console.log("OMGHAI!");
|
||||||
|
for (let day = 0; day < days; day++) {
|
||||||
|
console.log(`\n-------- day ${day} --------`);
|
||||||
|
console.log("name, sellIn, quality");
|
||||||
|
items.forEach(item => console.log(`${item.name}, ${item.sellIn}, ${item.quality}`));
|
||||||
|
gildedRose.updateQuality();
|
||||||
|
}
|
||||||
27
js-jest/test/texttest_fixture.js
Normal file
27
js-jest/test/texttest_fixture.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
const { Shop, Item } = require("../src/gilded_rose");
|
||||||
|
|
||||||
|
const items = [
|
||||||
|
new Item("+5 Dexterity Vest", 10, 20),
|
||||||
|
new Item("Aged Brie", 2, 0),
|
||||||
|
new Item("Elixir of the Mongoose", 5, 7),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||||
|
|
||||||
|
// This Conjured item does not work properly yet
|
||||||
|
new Item("Conjured Mana Cake", 3, 6),
|
||||||
|
];
|
||||||
|
|
||||||
|
const days = Number(process.argv[2]) || 2;
|
||||||
|
const gildedRose = new Shop(items);
|
||||||
|
|
||||||
|
console.log("OMGHAI!");
|
||||||
|
for (let day = 0; day < days; day++) {
|
||||||
|
console.log(`\n-------- day ${day} --------`);
|
||||||
|
console.log("name, sellIn, quality");
|
||||||
|
items.forEach(item => console.log(`${item.name}, ${item.sellIn}, ${item.quality}`));
|
||||||
|
gildedRose.updateQuality();
|
||||||
|
}
|
||||||
27
js-mocha/test/texttest_fixture.js
Normal file
27
js-mocha/test/texttest_fixture.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
const { Shop, Item } = require("../src/gilded_rose");
|
||||||
|
|
||||||
|
const items = [
|
||||||
|
new Item("+5 Dexterity Vest", 10, 20),
|
||||||
|
new Item("Aged Brie", 2, 0),
|
||||||
|
new Item("Elixir of the Mongoose", 5, 7),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
|
||||||
|
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||||
|
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||||
|
|
||||||
|
// This Conjured item does not work properly yet
|
||||||
|
new Item("Conjured Mana Cake", 3, 6),
|
||||||
|
];
|
||||||
|
|
||||||
|
const days = Number(process.argv[2]) || 2;
|
||||||
|
const gildedRose = new Shop(items);
|
||||||
|
|
||||||
|
console.log("OMGHAI!");
|
||||||
|
for (let day = 0; day < days; day++) {
|
||||||
|
console.log(`\n-------- day ${day} --------`);
|
||||||
|
console.log("name, sellIn, quality");
|
||||||
|
items.forEach(item => console.log(`${item.name}, ${item.sellIn}, ${item.quality}`));
|
||||||
|
gildedRose.updateQuality();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user