Javascript test snippets