Skip to content

Commit

Permalink
update tests to browser based (learn-co-students#5)
Browse files Browse the repository at this point in the history
* update tests to browser based

* fixed arrow functions
  • Loading branch information
alpha-convert authored and pletcher committed Jul 26, 2016
1 parent 904fa34 commit b74eb05
Show file tree
Hide file tree
Showing 9 changed files with 13,544 additions and 45 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"homepage": "https://github.com/learn-co-curriculum/js-beatles-loops-lab#readme",
"devDependencies": {
"chai": "^3.5.0",
"expect": "^1.20.2",
"jsdom": "^9.0.0",
"mocha": "^2.4.5",
"mocha-jsdom": "^1.1.0",
Expand Down
45 changes: 0 additions & 45 deletions test/beatles-test.js

This file was deleted.

20 changes: 20 additions & 0 deletions test/index-test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Mocha</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="mocha.js"></script>
<script src="../node_modules/expect/umd/expect.min.js"></script>
<script>mocha.setup('bdd');</script>
<script src="../index.js"></script>
<script src="index-test.js"></script>
<script>
mocha.run();
</script>
</body>
</html>
33 changes: 33 additions & 0 deletions test/index-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

it("returns an array of strings containing what instruments each instrument plays", function() {
const musicians = ["John Lennon", "Paul McCartney", "George Harrison", "Ringo Starr"];
const instruments = ["Guitar", "Bass Guitar", "Lead Guitar", "Drums"];

expect(theBeatlesPlay(musicians, instruments)).to.eql(["John Lennon plays Guitar", "Paul McCartney plays Bass Guitar", "George Harrison plays Lead Guitar", "Ringo Starr plays Drums"]);
});

describe('johnLennonFacts', function(){
it("returns an array of strings with exclamation points", function() {
expect(johnLennonFacts([
"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"
])).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!!!"]);

expect(johnLennonFacts([
"foo",
"bar",
])).to.eql(["foo!!!", "bar!!!"])
});
});

describe('iLoveTheBeatles', function() {
it("returns an array of 'I love the Beatles!' 8 times when passed the parameter 7 ", function() {
expect(iLoveTheBeatles(7)).to.eql(["I love the Beatles!", "I love the Beatles!", "I love the Beatles!", "I love the Beatles!", "I love the Beatles!", "I love the Beatles!", "I love the Beatles!", "I love the Beatles!"]);
});

it("returns an array of 'I love the Beatles!' once when passed the parameter 17", function() {
expect(iLoveTheBeatles(17)).to.eql(["I love the Beatles!"]);
});
});
Loading

0 comments on commit b74eb05

Please sign in to comment.