Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote two-fer to core and sync to 1.2.0 #649

Merged
merged 5 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
"text_formatting"
]
},
{
"slug": "two-fer",
"uuid": "7f49e997-4435-4f34-a020-bddc92c838ed",
"core": true,
"unlocked_by": null,
"difficulty": 1,
"topics": [
"optional_values",
"strings",
"text_formatting"
]
},
{
"slug": "resistor-color",
"uuid": "53be6837-c224-45f1-bff3-d7f74d6285ce",
Expand Down Expand Up @@ -223,20 +235,6 @@
"games"
]
},
{
"slug": "two-fer",
"uuid": "7f49e997-4435-4f34-a020-bddc92c838ed",
"core": false,
"unlocked_by": "hello-world",
"difficulty": 1,
"topics": [
"booleans",
"logic",
"optional_values",
"strings",
"text_formatting"
]
},
{
"slug": "leap",
"uuid": "7c8294ee-5924-4bf8-a72f-31d0e2d7d9a0",
Expand Down
5 changes: 2 additions & 3 deletions exercises/two-fer/example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const twoFer = (name) => {
const nameText = name || 'you';
return `One for ${nameText}, one for me.`;
export const twoFer = (name = 'you') => {
return `One for ${name}, one for me.`;
};
19 changes: 8 additions & 11 deletions exercises/two-fer/two-fer.spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { twoFer } from './two-fer';
import { twoFer } from './two-fer'

describe('twoFer()', () => {
test('no name given', () => {
const name = '';
expect(twoFer(name)).toEqual('One for you, one for me.');
});
expect(twoFer()).toEqual("One for you, one for me.")
})

xtest('a name given', () => {
const name = 'Alice';
expect(twoFer(name)).toEqual('One for Alice, one for me.');
});
expect(twoFer("Alice")).toEqual("One for Alice, one for me.")
})

xtest('another name given', () => {
const name = 'Bob';
expect(twoFer(name)).toEqual('One for Bob, one for me.');
});
});
expect(twoFer("Bob")).toEqual("One for Bob, one for me.")
})
})