Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zhendrikse committed Oct 17, 2024
1 parent c4365e5 commit 51844d4
Show file tree
Hide file tree
Showing 4 changed files with 581 additions and 891 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import { Item, GildedRose } from '../src/gilded-rose';
import {verify, verifyAsJson} from "approvals/lib/Providers/Jest/JestApprovals";
import { verify } from "approvals/lib/Providers/Jest/JestApprovals";

function convert_items_to_string(items = [] as Array<Item>) {
let items_as_string = items.map((item) => item.toString() + "\n")
Expand Down Expand Up @@ -34,7 +34,7 @@ describe('Gilded Rose', () => {
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 48),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
new Item("Backstage passes to a TAFKAL80ETC concert", 6, 47),
new Item("Backstage passes to a TAFKAL80ETC concert", 0, 50),
new Item("Backstage passes to a TAFKAL80ETC concert", 0, 50)
];
const gildedRose = new GildedRose(items);
const updated_items = gildedRose.updateQuality();
Expand Down
22 changes: 13 additions & 9 deletions presentations/gilded-rose.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,20 @@ highlightTheme: github-dark

- <!-- .element: class="fragment" -->
Explain various refactoring techniques
- <!-- .element: class="fragment" -->
[Creating a golden master / baseline](./approval-testing.md)
- <!-- .element: class="fragment" -->
Getting acquainted with mutation testing
- <!-- .element: class="fragment" -->
[Replace conditional with polymorphism](https://refactoring.guru/replace-conditional-with-polymorphism)
- <!-- .element: class="fragment" -->
[Refactor Negate If](https://wiki.c2.com/?RefactorNegateIf)
- <!-- .element: class="fragment" -->
[Extract method](https://wiki.c2.com/?ExtractMethod)
- <!-- .element: class="fragment" -->
Learn to refactor in _small_ steps
- <!-- .element: class="fragment" -->
The one and only useful use of code coverage
The one and only useful use of code coverage &#128521;

&nbsp;

Expand All @@ -54,13 +64,7 @@ highlightTheme: github-dark

## [Gilded Rose kata](https://github.com/emilybache/GildedRose-Refactoring-Kata)

Store where goods degrade in quality as they approach their sell date

(Prerequisite: [approval testing](../approval-testing/slides.md))

---

## System updates items daily
### System updates items daily

* `SellIn` = number of days left to sell the item
* `Quality` = how valuable the item is
Expand All @@ -70,7 +74,7 @@ Store where goods degrade in quality as they approach their sell date

### Task: add a new category of items

* "Conjured" items degrade in `Quality` twice as fast as normal items
* "Conjured" items degrade in `quality` twice as fast as normal items

---

Expand Down
Loading

0 comments on commit 51844d4

Please sign in to comment.