Skip to content

Commit

Permalink
Improve test output of dnd-character (#2470)
Browse files Browse the repository at this point in the history
[no important files changed]

* Don't fiddle with upstream files

* Provide more helpful test output
  • Loading branch information
mk-mxp authored Jul 30, 2024
1 parent 481dcfe commit 57c712f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.github/labels.yml
/.github/workflows/sync-labels.yml
/.github/workflows/no-important-files-changed.yml
exercises/**/README.md
!/README.md

Expand Down
27 changes: 25 additions & 2 deletions exercises/practice/dnd-character/dnd-character.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,44 @@ describe('D&D Character', () => {
expect(Character.rollAbility()).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid', () => {
xtest('random character is valid - strength', () => {
const Drizzt = new Character();

expect(Drizzt.strength).toBeLessThanOrEqual(18);
expect(Drizzt.strength).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - dexterity', () => {
const Drizzt = new Character();
expect(Drizzt.dexterity).toBeLessThanOrEqual(18);
expect(Drizzt.dexterity).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - constitution', () => {
const Drizzt = new Character();
expect(Drizzt.constitution).toBeLessThanOrEqual(18);
expect(Drizzt.constitution).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - intelligence', () => {
const Drizzt = new Character();
expect(Drizzt.intelligence).toBeLessThanOrEqual(18);
expect(Drizzt.intelligence).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - wisdom', () => {
const Drizzt = new Character();
expect(Drizzt.wisdom).toBeLessThanOrEqual(18);
expect(Drizzt.wisdom).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - charisma', () => {
const Drizzt = new Character();
expect(Drizzt.charisma).toBeLessThanOrEqual(18);
expect(Drizzt.charisma).toBeGreaterThanOrEqual(3);
});

xtest('random character is valid - hitpoints', () => {
const Drizzt = new Character();
expect(Drizzt.hitpoints).toEqual(10 + abilityModifier(Drizzt.constitution));
});

Expand Down

0 comments on commit 57c712f

Please sign in to comment.