How to use the test.run function in test

To help you get started, we’ve selected a few test examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ringo / ringojs / test / integration-tests / require-index / main.js View on Github external
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));
}
github ringo / ringojs / test / binary / all.js View on Github external
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));
}
github ringo / ringojs / test / file / test-fs-isAbsolute.js View on Github external
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));
}
github kriskowal / narwhal-lib / tests / commonjs / es5 / all-tests.js View on Github external
exports.testFunctionBind = require("./bind");
if (require.main == module)
    require("os").exit(require("test").run(exports));
github zaach / jison / tests / grammar / grammar-tests.js View on Github external
#!/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));
github zaach / jison / tests / lexer / lexer-tests.js View on Github external
#!/usr/bin/env narwhal

exports.testRegExpLexer = require("./regexplexer");

if (require.main === module.id)
    require("os").exit(require("test").run(exports)); 
github ringo / ringojs / test / ringo / jsgi / all.js View on Github external
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));
}
github ringo / ringojs / test / singletons / all.js View on Github external
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));
}
github grob / ringo-sqlstore / test / runner.js View on Github external
const run = exports.run = function(scope, args) {
    const remainingArgs = setDatabase(Array.slice(args, 1));
    return require('test').run(scope, remainingArgs[0]);
};
github ringo / stick / examples / demo / actions.js View on Github external
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"
    });
});

test

Node.js 18's node:test, as an npm package

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis