Add method for asserting IM state to testing helpers.