Javascript TDD utility