Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var assert = require("assert");
var calc = require("./calculator");
exports.testCalculator = function() {
assert.equal(calc.add(3,5), 8);
assert.equal(calc.substract(5,3), 2);
};
if (require.main === module) {
require('system').exit(require("test").run(module.id));
}
exports.testBytearray = require('./bytearray-tests');
exports.testBytearrayEncodings = require('./bytearray-encodings-tests');
exports.testBytestring = require('./bytestring-tests');
exports.testBytestringEncodings = require('./bytestring-encodings-tests');
exports.testBytearraySlice = require('./bytearray-slice');
if (require.main === module) {
require('system').exit(require('test').run(module.id));
}
var assert = require("assert");
var fs = require('fs');
exports.testIsAbsolute = function () {
assert.isTrue(fs.isAbsolute(java.lang.System.getProperty("java.home")));
assert.isTrue(fs.isAbsolute(fs.absolute(module.path)));
assert.isTrue(fs.isRelative("./"));
};
if (require.main === module) {
require('system').exit(require("test").run(module.id));
}
exports.testFunctionBind = require("./bind");
if (require.main == module)
require("os").exit(require("test").run(exports));
#!/usr/bin/env narwhal
//exports.testBNF = require("./bnf");
exports.testBNFParse = require("./bnf_parse");
exports.testConvert = require("./json2jison");
//exports.testLex = require("./lex");
exports.testLexParse = require("./lex_parse");
exports.testEBNF = require("./ebnf");
exports.testEBNFParse = require("./ebnf_parse");
if (require.main === module)
require("os").exit(require("test").run(exports));
#!/usr/bin/env narwhal
exports.testRegExpLexer = require("./regexplexer");
if (require.main === module.id)
require("os").exit(require("test").run(exports));
exports.testAsyncResponse = require('./asyncresponse_test');
exports.testResponse = require('./response_test');
exports.testResponseRange = require('./response_range_test');
if (require.main === module) {
require("system").exit(require("test").run(exports));
}
exports.testBasics = require("./test-singleton-basics");
exports.testWorkers = require("./test-singleton-multiple-workers");
exports.testComplexObject = require("./test-singleton-complex-object");
if (require.main === module) {
require("system").exit(require("test").run(exports));
}
const run = exports.run = function(scope, args) {
const remainingArgs = setDatabase(Array.slice(args, 1));
return require('test').run(scope, remainingArgs[0]);
};
app.get("/testing", function(req) {
if (req.params.runtests) {
var test = require("ringo/engine").getRingoHome().getResource("test/most.js");
var tests = require(test.path);
var formatter = new (require("./helpers").HtmlTestFormatter)();
require("test").run(tests, formatter);
return response.html(formatter);
}
return render('templates/testing.txt', {
title: "Unit Testing"
});
});