use promises and generators in tests