Fixed spec runs before requirejs callback which causes unexpected result

Moved launch spec code insde of requirejs callback if there's callback definition