diff --git a/config.json b/config.json index 31d334aa08..1526780fc5 100644 --- a/config.json +++ b/config.json @@ -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", @@ -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", diff --git a/exercises/two-fer/example.js b/exercises/two-fer/example.js index 675a8b7058..ac908cf32e 100644 --- a/exercises/two-fer/example.js +++ b/exercises/two-fer/example.js @@ -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.`; }; diff --git a/exercises/two-fer/two-fer.spec.js b/exercises/two-fer/two-fer.spec.js index 1653b41db0..e7912e60bb 100644 --- a/exercises/two-fer/two-fer.spec.js +++ b/exercises/two-fer/two-fer.spec.js @@ -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.") + }) +})