improve js test snippets