Skip to content

Instantly share code, notes, and snippets.

@rotoshine
Created October 13, 2012 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rotoshine/3885593 to your computer and use it in GitHub Desktop.
Save rotoshine/3885593 to your computer and use it in GitHub Desktop.
Calculator.add test2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Calculator Test</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.10.0.css">
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="Calculator.js"></script>
<script type="text/javascript">
$(document).ready(function(){
test("add 함수 테스트", function(){
ok(Calcurator.hasOwnProperty("add"), "add 함수 존재");
equal(Calcurator.add(1, 2), 3, "add 함수에 1과 2를 더한 결과는 3");
equal(Calcurator.add("1", 2), 3, "add 함수에 1(문자열)과 2를 더한 결과는 3");
});
});
</script>
</head>
<body>
<div id="qunit"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment