Is it a good practice to use ready() Method inside an If-else block to call a function?

I am tryin to call the test() function onload. This is how I am doing it:

if ($('.partical .sectionA').length) {
    $(document).ready(function(){
        test($(this));
    });
 }
test(something){...}

I find it odd to use a ready() method inside an If Else statement and I am wondering if this is a good practice or is there a better way to call the test function on page load?