convert tests to use promises correctly