Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Bob = function (input) {
- this.input = input;
- }
- Bob.prototype.hey = function () {
- console.log(this.input);
- var whatever = this.input[this.input.length - 1];
- console.log(whatever);
- if (whatever === '.' || /[a - z]/.test(whatever)) {
- return 'Whatever.';
- }
- }
- module.exports = Bob;
- var Bob = require('./bob.js');
- describe('Bob', function () {
- var bob = new Bob();
- it('stating something', function () {
- var result = bob.hey('Tom-ay-to, tom-aaaah-to.');
- expect(result).toEqual('Whatever.');
- });
Add Comment
Please, Sign In to add comment