単体テストを書き始めました。signup.js
別のスクリプトから関数を呼び出す必要がありますunittest.js
。これどうやってするの?
Unittest.html
両方のスクリプトを組み込みます。
<html>
<head>
<script scr ="signup.js"></script>
<script src="unittest,js"></script>
</head>
</html>
これはsignup.js
、私がテストしなければならないものです。
YUI.use(function(Y){
demo : function(){
window.alert('hello);
}
});
unittest.js
:
YUI.use(function(Y){
var abc = new Y.Test.case(
testOk : function(){
demo(); // Calling this function but not working
<Some_Assestion_Stuff_Here>
}
);
});