Skip to content

Commit

Permalink
Provide more helpful test output
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-mxp committed May 25, 2024
1 parent 51cb106 commit f643f47
Showing 1 changed file with 25 additions and 2 deletions.
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 f643f47

Please sign in to comment.