Can you add test to check that it raises `TypeError`?

Thanks @jnothman