Skip to content

Commit 904fa34

Browse files
committed
Update test instructions
1 parent 2a6520d commit 904fa34

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Make sure you run the tests with `learn`.
1111

1212
+ Create a function `theBeatlesPlay`, which accepts two parameters- an array of musicians and an array of instruments. The body of the function should create an empty array stored in a variable. The function should also contain a for loop which loops over the array of musicians. You'll want to be careful about what value you set your counter variable to store. (Hint: Think about what the first index of an array is). The first time through the loop, the body of the loop should create a string using the first index of the musicians array and the first index of the instruments array: `"John Lennon plays guitar"`. This string should be added to the empty array you created. The loop should make the same sentence for every member of the musicians array. The function should return the array of new strings.
1313

14-
+ Create a function `johnLennonFacts`. Inside the function, create an array which contains facts about John Lennon:
14+
+ Create a function `johnLennonFacts`. This function will accept one argument, an array of facts about John Lennon (note that it might not be exactly the following facts):
1515

1616
```js
1717
const facts = [
@@ -22,9 +22,7 @@ const facts = [
2222
];
2323
```
2424

25-
The function should also create a second variable that stores an empty array. Use a while loop to loop over the facts array and add `"!!!"` to the end of every fact. The new string with the exclamation points should be added to the empty array.
26-
27-
The function should return the array of strings with exclamation points.
25+
Use a while loop to loop over the facts array and add `"!!!"` to the end of every fact. The function should return an array of strings with exclamation points.
2826

2927
+ Create a function `iLoveTheBeatles` which accepts a number as a parameter. The body of the function should create a variable that stores an empty array. Then, implement a do-while loop inside the function that adds `"I love the Beatles!"` to the empty array. Then the loop should increment the number passed in as a parameter. The condition of the loop should check to see that the parameter number is less than `15`. The function should return the array with the strings `"I love the Beatles!"`.
3028

test/beatles-test.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ describe('theBeatlesPlay', () => {
1919

2020
describe('johnLennonFacts', () => {
2121
it("returns an array of strings with exclamation points", () => {
22-
expect(johnLennonFacts()).to.eql(["He was the last Beatle to learn to drive!!!", "He was never a vegetarian!!!", "He was a choir boy and boy scout!!!", "He hated the sound of his own voice!!!"]);
22+
expect(johnLennonFacts([
23+
"He was the last Beatle to learn to drive",
24+
"He was never a vegetarian",
25+
"He was a choir boy and boy scout",
26+
"He hated the sound of his own voice"
27+
])).to.eql(["He was the last Beatle to learn to drive!!!", "He was never a vegetarian!!!", "He was a choir boy and boy scout!!!", "He hated the sound of his own voice!!!"]);
28+
29+
expect(johnLennonFacts([
30+
"foo",
31+
"bar",
32+
])).to.eql(["foo!!!", "bar!!!"])
2333
});
2434
});
2535

0 commit comments

Comments
 (0)