Update test-driven components

This commit is contained in:
Namhyeon Go 2020-07-27 15:41:55 +09:00
parent b8fe0ba198
commit bff8a2c42a
5 changed files with 28 additions and 7 deletions

View File

@ -1,3 +0,0 @@
exports.main: function() {
console.log("Hello world");
};

View File

@ -685,8 +685,6 @@ function setUp() {}
*/
function tearDown() {}
//Snegopat.
// TODO: ðåàëèçîâàòü ïîëíîöåííûé òðåéñåð/ëîããåð.
function trace(message, value, marker) {
var text = message;
@ -695,7 +693,6 @@ function trace(message, value, marker) {
WScript.Echo(text);
}
/////Snegopat.
function warn() {
trace(arguments[0], arguments[1]);

View File

@ -8,7 +8,7 @@
},
"scripts": {
"start": "start.bat",
"test": "cscript app.js helloworld"
"test": "cscript app.js testloader"
},
"repository": {
"type": "git",

19
test/test.example.js Normal file
View File

@ -0,0 +1,19 @@
(function() {
return {
setUp: function() {
inform('Starting...');
},
tearDown: function() {
inform('Finishing...')
},
testGreenTest: function () {
assert("this is true", true);
},
testRedTest: function () {
assert("this is false", false);
}
};
})();

8
testloader.js Normal file
View File

@ -0,0 +1,8 @@
////////////////////////////////////////////////////////////////////////
// Testloader
////////////////////////////////////////////////////////////////////////
var JsUnit = require("lib/jsunit").JsUnit;
exports.main = function(args) {
JsUnit.Runner.run("test");
};