fix(mock): prevent NPE when module definition outside of it.