Skip to content

Instantly share code, notes, and snippets.

@zischwartz
Last active January 3, 2018 18:19
Show Gist options
  • Save zischwartz/408db70fbe7d2eb2249de2a4ff6a7fe0 to your computer and use it in GitHub Desktop.
Save zischwartz/408db70fbe7d2eb2249de2a4ff6a7fe0 to your computer and use it in GitHub Desktop.
let cards = [0,1,2,3,4]
describe("The cards variable", ()=> {
it("should be defined", ()=> {
expect(cards).toBeDefined()
})
it("should have a length of 5", ()=> {
expect(cards.length).toBe(5)
})
it("have cat as the 0th element", ()=> {
expect(cards[0]).toBe('cat')
})
});
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<link rel="shortcut icon" type="image/png" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine.css">
</head>
<body>
<div class="content">
<!-- <span id="greet">Hello</span> world -->
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/jasmine-html.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.8.0/boot.js"></script>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="spec.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment