Testing a mixin function I have a mixin function which is as follows - 

function mixin(receiver, supplier) {
    for (var property in supplier) {
        if (supplier.hasOwnProperty(property)) {
            receiver[property] = supplier[property];
        }
    }
}


To test this function, I am using the ok method of Qunit - 

test('Mixin Test Runner', function () {
    // using OK method
    ok(function () {
        var receiver = {
            name: 'Abul Moksud',
            age: '60'
        };

        var supplier = {
            hands: 2
        };

        mixin(receiver, supplier);

        return receiver.hasOwnProperty('hands') &amp;&amp; (receiver.hands === 2);
    }(), "Abul Moksud now has two hands");
});


I am an absolute beginner in both unit testing and QUnit. Is my approach OK here, or is there any better option?
Your code is correct, but can be simplified. ok method usually gets an expression rather than a in-place function that is immediately evaluated.

Here is how I would write this test:

test('Mixin Test Runner', function () {
    var receiver = {
        name: 'Abul Moksud',
        age: '60'
    };

    var supplier = {
        hands: 2
    };

    mixin(receiver, supplier);

    //Assertion phase
    ok(receiver.hasOwnProperty("hands"), "hands property is defined on reciever");
    equal(receiver.hands, 2, "Abul Moksud now has two hands");
});