js snippets for testing hooks