 # atmantree's solution

## to Two Fer in the TypeScript Track

Published at Jul 13 2018 · 0 comments
Instructions
Test suite
Solution

`Two-fer` or `2-fer` is short for two for one. One for you and one for me.

``````"One for X, one for me."
``````

When X is a name or "you".

If the given name is "Alice", the result should be "One for Alice, one for me." If no name is given, the result should be "One for you, one for me."

## Setup

Go through the setup instructions for TypeScript to install the necessary dependencies:

http://exercism.io/languages/typescript

## Requirements

Install assignment dependencies:

``````\$ yarn install
``````

## Making the test suite pass

Execute the tests with:

``````\$ yarn test
``````

## Source

https://en.wikipedia.org/wiki/Two-fer

## Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.

### two-fer.test.ts

``````import TwoFer from './two-fer'

describe('TwoFer', () => {
it('no name given', () => {
const expected = 'One for you, one for me.'
expect(TwoFer.twoFer()).toEqual(expected)
})

xit('a name given', () => {
const expected = 'One for Alice, one for me.'
expect(TwoFer.twoFer('Alice')).toEqual(expected)
})

xit('another name given', () => {
const expected = 'One for Bob, one for me.'
expect(TwoFer.twoFer('Bob')).toEqual(expected)
})
})``````
``````class TwoFer {
static twoFer( who = 'you') {
return `One for \${who}, one for me.`
}
}

export default TwoFer``````