-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Caden Marinozzi
committed
Apr 5, 2024
1 parent
32fb769
commit f192657
Showing
1 changed file
with
36 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
import MarketHashNameBuilder from '../../dist/index'; | ||
|
||
const tests = { | ||
'karambit doppler factorynew': '★ Karambit | Doppler (Factory New)', | ||
'aK-47 case Hardened FT': 'AK-47 | Case Hardened (Field-Tested)', | ||
'AWP | Asiimov (Field-Tested)': 'AWP | Asiimov (Field-Tested)', | ||
'Hydra Case key': 'Operation Hydra Case Key', | ||
'titan Holo sticker katowice 2014': | ||
'Sticker | Titan (Holo) | Katowice 2014', | ||
'Fracture Case Key': 'Operation Fracture Case Key', | ||
'm9 bayonet': '★ M9 Bayonet', | ||
'Specialist Gloves fade FN': '★ Specialist Gloves | Fade (Factory New)', | ||
const testTypes = { | ||
weapons: { | ||
'aK-47 case Hardened FT': 'AK-47 | Case Hardened (Field-Tested)', | ||
'AWP | Asiimov (Field-Tested)': 'AWP | Asiimov (Field-Tested)', | ||
}, | ||
knives: { | ||
'karambit doppler factorynew': '★ Karambit | Doppler (Factory New)', | ||
'phase 2 butterfly knife slaughter fn': | ||
'★ Butterfly Knife | Slaughter (Factory New)', | ||
'm9 bayonet': '★ M9 Bayonet', | ||
}, | ||
stickers: { | ||
'titan Holo sticker katowice 2014': | ||
'Sticker | Titan (Holo) | Katowice 2014', | ||
}, | ||
gloves: { | ||
'Specialist Gloves fade FN': '★ Specialist Gloves | Fade (Factory New)', | ||
'Bloodhound Gloves Charred FT': | ||
'★ Bloodhound Gloves | Charred (Field-Tested)', | ||
}, | ||
cases: { | ||
'chroma 2 case': 'Operation Chroma 2 Case', | ||
'operation shattered web case': 'Operation Shattered Web Case', | ||
}, | ||
'case keys': { | ||
'Hydra Case key': 'Operation Hydra Case Key', | ||
'Fracture Case Key': 'Operation Fracture Case Key', | ||
}, | ||
}; | ||
|
||
for (const [input, expected] of Object.entries(tests)) { | ||
test(input, () => { | ||
const builder = new MarketHashNameBuilder(); | ||
const result = builder.build(input); | ||
expect(result).toBe(expected); | ||
}); | ||
for (const [type, tests] of Object.entries(testTypes)) { | ||
for (const [input, expected] of Object.entries(tests)) { | ||
test(`${type}: ${input}`, () => { | ||
const builder = new MarketHashNameBuilder(); | ||
const result = builder.build(input); | ||
expect(result).toBe(expected); | ||
}); | ||
} | ||
} |