-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from lycan-city/feature/32/screenplay
Feature/32/screenplay
- Loading branch information
Showing
10 changed files
with
165 additions
and
48 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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
}, | ||
"globals": { | ||
"describe": true, | ||
"it": true | ||
"it": true, | ||
"beforeEach": true | ||
} | ||
} |
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,6 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "7" | ||
- "6" | ||
- "5" | ||
- "4" |
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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"apprentice_seer": 1, | ||
"big_bad_wolf": 1, | ||
"cupid": 1, | ||
"cursed": 1, | ||
"dire_wolf": 1, | ||
"diseased": 1, | ||
"doppelganger": 1, | ||
"fruit_brute": 1, | ||
"hoodlum": 1, | ||
"hunter": 1, | ||
"lovebirds": 1, | ||
"lycan": 1, | ||
"mason": 1, | ||
"minion": 1, | ||
"nostradamus": 1, | ||
"the_count": 1, | ||
"tough_guy": 1, | ||
"wild_child": 1, | ||
"wolf_man": 1, | ||
"wolverine": 1 | ||
} |
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 |
---|---|---|
|
@@ -40,4 +40,4 @@ | |
"old_hag", | ||
"spellcaster", | ||
"meeting" | ||
] | ||
] |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* eslint-disable no-undef*/ | ||
/* eslint-disable no-unused-expressions*/ | ||
/* eslint-disable func-names */ | ||
const chai = require('chai'); | ||
const moderator = require('../src/moderator'); | ||
|
||
const expect = chai.expect; | ||
|
||
describe('Screenplay', () => { | ||
describe('fromGame()', () => { | ||
beforeEach(function () { | ||
const deck = [ | ||
{ key: 'villager', amount: 25, }, | ||
{ key: 'werewolf', amount: 12, }, | ||
{ key: 'seer', amount: 1, }, | ||
{ key: 'cupid', amount: 1, }, | ||
{ key: 'cult_leader', amount: 1, }, | ||
]; | ||
|
||
const gameDeck = [ | ||
{ key: 'werewolf', amount: 1, }, | ||
{ key: 'cult_leader', amount: 1, }, | ||
{ key: 'villager', amount: 7, }, | ||
{ key: 'cupid', amount: 1 } | ||
]; | ||
|
||
this.screenplay = moderator.fromGame(gameDeck, deck); | ||
}); | ||
|
||
it('is expected to not be null or undefined', function () { | ||
expect(this.screenplay) | ||
.to.not.be.undefined | ||
.and.to.not.be.null; | ||
}); | ||
|
||
it('is expected to be an array', function () { | ||
expect(this.screenplay).to.be.an('array'); | ||
}); | ||
|
||
it('is expected to have `key` and `level`', function () { | ||
this.screenplay.forEach(call => | ||
expect(call).to.have.all.keys('key', 'level', 'firstNight') | ||
); | ||
}); | ||
}); | ||
}); |