leobalter / goiabada

experimental project providing a very simple (and incomplete) unit test tool written using ES6 features.
Other
25 stars 4 forks source link

Default assertion descriptions #4

Closed rwaldron closed 9 years ago

rwaldron commented 9 years ago

Currently:

equal( value, expected, description ) {
    var result = value == expected;

    this.register( "equal", result, description, value, expected );

    return !!result;
}

But a default parameter definition could be used to define a simple, default "description":

equal( value, expected, description = `${value} is equal to ${expected}` ) {
    var result = value == expected;

    this.register( "equal", result, description, value, expected );

    return !!result;
}
leobalter commented 9 years ago

Fixed on @16d8245