diff --git a/exercises/hello-world/example.js b/exercises/hello-world/example.js index aea4e54527..a9d02ded47 100644 --- a/exercises/hello-world/example.js +++ b/exercises/hello-world/example.js @@ -1,9 +1,6 @@ -class HelloWorld { - hello(name = 'World') { - return `Hello, ${name}!`; - } +const helloWorld = () => { + return 'Hello, World!'; } -export default HelloWorld; - +export default helloWorld; diff --git a/exercises/hello-world/hello-world.js b/exercises/hello-world/hello-world.js index 29a5e5094d..967765837c 100644 --- a/exercises/hello-world/hello-world.js +++ b/exercises/hello-world/hello-world.js @@ -3,13 +3,10 @@ // convenience to get you started writing code faster. // -class HelloWorld { - hello() { - // - // YOUR CODE GOES HERE - // - } +const helloWorld = () => { + // + // YOUR CODE GOES HERE + // } -export default HelloWorld; - +export default helloWorld; diff --git a/exercises/hello-world/hello-world.spec.js b/exercises/hello-world/hello-world.spec.js index c1923baafb..40fdd25c95 100644 --- a/exercises/hello-world/hello-world.spec.js +++ b/exercises/hello-world/hello-world.spec.js @@ -1,18 +1,7 @@ -import HelloWorld from './hello-world'; +import helloWorld from './hello-world'; describe('Hello World', () => { - const helloWorld = new HelloWorld(); - - it('says hello world with no name', () => { - expect(helloWorld.hello()).toEqual('Hello, World!'); - }); - - xit('says hello to bob', () => { - expect(helloWorld.hello('Bob')).toEqual('Hello, Bob!'); - }); - - xit('says hello to sally', () => { - expect(helloWorld.hello('Sally')).toEqual('Hello, Sally!'); + it('says hello', () => { + expect(helloWorld()).toEqual('Hello, World!'); }); }); -