generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated Jasmine as a test suite and setup some tests
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- Instructions from https://github.com/TravelTimN/ci-ifd-lead/blob/master/week5-jasmine/jasmine.md --> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Zengarden Jasmin Testing</title> | ||
<!-- Jasmine CSS --> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.5.0/jasmine.css" type="text/css"> | ||
</head> | ||
<body> | ||
<!-- Jasmine JS files --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/jasmine.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/jasmine-html.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.6.0/boot.js"></script> | ||
|
||
<!-- Your Source Code (this must come before the tests!) --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.0/howler.min.js"></script> | ||
<script src="scripts/app.js"></script> | ||
|
||
|
||
<!-- Specifications (this must come after the source code!) --> | ||
<script src="specs/appSpecs.js"></script> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
describe('Meditation App', ()=>{ | ||
describe("Streakbar Management", function() { | ||
beforeEach(function() { | ||
localStorage.clear() | ||
}); | ||
it("should initialize the streak", function() { | ||
streakInit(); | ||
expect(streak).toBe(0); | ||
}); | ||
it("should reset Streak if dateLastDone != oneDayAgo", function(){ | ||
dateLastDone = setTodayDate(); | ||
oneDayAgo = setOneDayAgo(); | ||
expect(checkStreak()).toBe(true) | ||
}) | ||
it("should store global variables", function(){ | ||
expect(countdownleft).toBe(3); | ||
}) | ||
}); | ||
describe("Format Duration", function() { | ||
it("format 60 seconds to 1:00", function() { | ||
expect(formatDuration(60)).toBe("1:00"); | ||
}); | ||
it("format 90 seconds to 1:30", function() { | ||
expect(formatDuration(90)).toBe("1:30") | ||
}); | ||
it("format 0 seconds to 0:00", function() { | ||
expect(formatDuration(0)).toBe("0:00") | ||
}); | ||
it("format 64 seconds to 1:04", function() { | ||
expect(formatDuration(64)).toBe("1:04") | ||
}); | ||
}); | ||
}); |