Created
April 7, 2017 16:58
-
-
Save ernestohs/481132a1d268bc923e0e1de751495dc5 to your computer and use it in GitHub Desktop.
Tests // source https://jsbin.com/xihehox
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Tests</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"></script> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
describe("tricky function", function() { | |
it("function existanse", function() { | |
expect(typeof findPeriod).toEqual('function'); | |
}); | |
it("function result 1", function() { | |
expect(findPeriod(10, 10)).toEqual('1'); | |
}); | |
it("function result 2", function() { | |
expect(findPeriod(10, 3)).toEqual('3,(3)'); | |
}); | |
it("function result 3", function() { | |
expect(findPeriod(10, 7)).toEqual('1,(428571)'); | |
}); | |
it("function result 3.2", function() { | |
expect(findPeriod(10, 7)).not.toEqual( '1,(4285714285714)'); | |
}); | |
it("function result 4", function() { | |
expect(findPeriod(Math.PI, 1)).toEqual('3,(1415926535897)'); | |
}); | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Tests</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css"> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"><\/script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"><\/script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"><\/script> | |
</head> | |
<body> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
describe("tricky function", function() { | |
it("function existanse", function() { | |
expect(typeof findPeriod).toEqual('function'); | |
}); | |
it("function result 1", function() { | |
expect(findPeriod(10, 10)).toEqual('1'); | |
}); | |
it("function result 2", function() { | |
expect(findPeriod(10, 3)).toEqual('3,(3)'); | |
}); | |
it("function result 3", function() { | |
expect(findPeriod(10, 7)).toEqual('1,(428571)'); | |
}); | |
it("function result 3.2", function() { | |
expect(findPeriod(10, 7)).not.toEqual( '1,(4285714285714)'); | |
}); | |
it("function result 4", function() { | |
expect(findPeriod(Math.PI, 1)).toEqual('3,(1415926535897)'); | |
}); | |
});</script></body> | |
</html> |
This file contains hidden or 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
describe("tricky function", function() { | |
it("function existanse", function() { | |
expect(typeof findPeriod).toEqual('function'); | |
}); | |
it("function result 1", function() { | |
expect(findPeriod(10, 10)).toEqual('1'); | |
}); | |
it("function result 2", function() { | |
expect(findPeriod(10, 3)).toEqual('3,(3)'); | |
}); | |
it("function result 3", function() { | |
expect(findPeriod(10, 7)).toEqual('1,(428571)'); | |
}); | |
it("function result 3.2", function() { | |
expect(findPeriod(10, 7)).not.toEqual( '1,(4285714285714)'); | |
}); | |
it("function result 4", function() { | |
expect(findPeriod(Math.PI, 1)).toEqual('3,(1415926535897)'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment