I am trying to move from mocha to AVA and reproduce this behavior from mocha
it('renders the introduction text if api request is correct', (done) => {
const vm = mount(AnswerBeat, options);
moxios.stubRequest('/beatUsers/4', {
status: 200,
response: [
{ type: 'text', question: 'example text of question' },
{ type: 'introduction', question: 'INTRODUCTION TEXT HERE' },
],
});
moxios.wait(() => {
t.is(vm.welcomeText, 'INTRODUCTION TEXT HERE');
done();
});
});
to AVA. This is my code so far, but test ends with no assertions made:
test('it renders the introduction text if api request is correct', async (t) => {
const vm = mount(AnswerBeat, options);
moxios.stubRequest('/beatUsers/4', {
status: 200,
response: [
{ type: 'text', question: 'example text of question' },
{ type: 'introduction', question: 'INTRODUCTION TEXT HERE' },
],
});
await moxios.wait(() => {
t.is(vm.welcomeText, 'INTRODUCTION TEXT HERE');
});
});
Thank you!