twitch-speak
Version:
T H I S L I B R A R Y D E F I E S D E S C R I P T I O N B O Y S
92 lines (71 loc) • 2.98 kB
JavaScript
;
var _ = require('lodash');
var expect = require('chai').expect;
var twitchSpeakPath = '../../../src/lib/twitch-speak';
var TwitchSpeak;
var twitchSpeak;
describe('I H A V E A T W I T C H S P E A K M O D U L E', function() {
var stringToTranslate = 'How are you today?';
beforeEach(function() {
TwitchSpeak = require(twitchSpeakPath);
twitchSpeak = new TwitchSpeak();
});
describe('A N D I I N S P E C T T H E M O D U L E', function() {
it('S H O U L D H A V E T H E C O R R E C T F U N C T I O N S', function(done) {
var hasBro = _(twitchSpeak).has('bro');
var hasDown = _(twitchSpeak).has('down');
var isHard = _(twitchSpeak).has('hard');
var hasOn = _(twitchSpeak).has('on');
var hasPrettyPrint = _(twitchSpeak).has('prettyPrint');
var hasTheBoys = _(twitchSpeak).has('tellItToTheBoys');
var hasSpeak = _(twitchSpeak).has('speak');
expect(hasBro).to.equal(true);
expect(hasDown).to.equal(true);
expect(isHard).to.equal(true);
expect(hasOn).to.equal(true);
expect(hasSpeak).to.equal(true);
expect(hasPrettyPrint).to.equal(true);
expect(hasTheBoys).to.equal(true);
done();
});
});
describe('A N D I H A V E I M P O R T A N T T H I N G S T O S A Y', function() {
var expectedString = 'H O W A R E Y O U T O D A Y';
var translatedString;
describe('W H E N I C A L L T H E M O D U L E', function() {
beforeEach(function () {
translatedString = twitchSpeak.bro().down().hard().on(stringToTranslate).speak();
});
it('S H O U L D S A Y I T L O U D A N D C L E A R', function(done) {
expect(translatedString).to.equal(expectedString);
done();
});
});
}); // E N D I M P O R T A N T
describe('A N D I W A N T M Y W O R D S T O B E S E P A R A T E D', function() {
var expectedString = 'H O W A R E Y O U T O D A Y';
var translatedString;
describe('W H E N I C A L L T H E M O D U L E', function() {
beforeEach(function () {
translatedString = twitchSpeak.bro().down().hard().on(stringToTranslate).prettyPrint().speak();
});
xit('S H O U L D S A Y I T L O U D A N D C L E A R', function(done) {
expect(translatedString).to.equal(expectedString);
done();
});
});
}); // E N D S E P A R A T E D
describe('A N D I N E E D T O B E P L A Y I N G W I T H T H E B O Y S', function() {
var expectedString = 'H O W A R E Y O U T O D A Y B O Y S';
var translatedString;
describe('W H E N I C A L L T H E M O D U L E', function() {
beforeEach(function () {
translatedString = twitchSpeak.bro().down().hard().on(stringToTranslate).tellItToTheBoys().speak();
});
xit('S H O U L D S A Y I T L O U D A N D C L E A R', function(done) {
expect(translatedString).to.equal(expectedString);
done();
});
});
}); // E N D W I T H B O Y S
});