From 1bbee2f0d7300739b2f9c60f9522a0e163838c96 Mon Sep 17 00:00:00 2001 From: Jonathan Ho Date: Tue, 24 Jan 2023 07:38:39 -0800 Subject: [PATCH] test(rest): fix "TypeError: [Function] is not a thenable" (#2736) --- packages/rest/tests/e2e/user.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/rest/tests/e2e/user.spec.ts b/packages/rest/tests/e2e/user.spec.ts index 55120a963..3e74f6406 100644 --- a/packages/rest/tests/e2e/user.spec.ts +++ b/packages/rest/tests/e2e/user.spec.ts @@ -1,7 +1,7 @@ import chai, { expect } from 'chai' +import chaiAsPromised from 'chai-as-promised' import { describe, it } from 'mocha' import { rest } from './utils.js' -import chaiAsPromised from 'chai-as-promised' chai.use(chaiAsPromised) describe('[rest] User related tests', () => { @@ -32,9 +32,7 @@ describe('[rest] User related tests', () => { }) it('With an invalid user id', async () => { - await expect(() => { - rest.getUser('123') - }).eventually.throws + await expect(rest.getUser('123')).eventually.throws }) }) })