Add common unit tests to precommit

Thanks to Calvin's pr.