Skip to content

Confusing syntax: addTest/go #18

@DazWilkin

Description

@DazWilkin

I find this syntax (from the readme) confusing:

var test = TypedJS.addTest('concat :: String -> String -> String', concat);
TypedJS.go([test]);

The "addTest" function name suggests (to me) that TypedJS is maintaining an internal collection of the tests for which I'd expect to be able to call 'go' to run the current tests:

TypedJS.addTest('concat :: String -> String -> String', concat);
TypedJS.go();

Perhaps it would be more appropriate to rename "addTest" to "createTest" and "go" to "runTests"?

var tests = $.map([{
    name: concat,
    type: "concat :: String, String -> Boolean"},
{
    name: add,
    type: "add :: Number, Number -> Number"}], function(func) {
    return TypedJS.createTest(func.type, func.name);
});
TypedJS.runTests(tests);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions