Skip to content

Commit

Permalink
Make hello-world more simple (#273)
Browse files Browse the repository at this point in the history
by always expecting "Hello, World!"

Change in x-common:
[here](exercism/problem-specifications#544)

Upcoming new exercise to kinda replace `hello-world`:
[here](exercism/problem-specifications#759)

Since this `hello-world` is just meant to be a sanity check for
everything working, I also went ahead and removed the use of class
for the sake of simplicity.
We can introduce classes with the next `two-fer` exercise.
  • Loading branch information
tejasbubane authored and matthewmorgan committed Apr 18, 2017
1 parent 8764748 commit 9e0305b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
9 changes: 3 additions & 6 deletions exercises/hello-world/example.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

class HelloWorld {
hello(name = 'World') {
return `Hello, ${name}!`;
}
const helloWorld = () => {
return 'Hello, World!';
}

export default HelloWorld;

export default helloWorld;
13 changes: 5 additions & 8 deletions exercises/hello-world/hello-world.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
17 changes: 3 additions & 14 deletions exercises/hello-world/hello-world.spec.js
Original file line number Diff line number Diff line change
@@ -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!');
});
});

0 comments on commit 9e0305b

Please sign in to comment.