How to use the expect.expect function in expect

To help you get started, we’ve selected a few expect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poetapp / frost-api / test / Integration / tokens / create.ts View on Github external
it('should return an object with LiveApiToken', async function() {
        const response = await frost.create()
        const apiToken = await frost.createApiToken(response.token, Network.LIVE)
        expect(apiToken).to.be.an('object')
        expect(apiToken.apiToken.slice(0, 5)).to.not.eq('TEST_')
        expect(apiToken).to.have.all.keys('apiToken')
      })
    })
github poetapp / frost-api / test / Integration / accounts / create.ts View on Github external
it(`should return a login token`, async function() {
        await frost.create()
        const { token } = await getDataVerifiedAccount(mail)
        const verify = await frost.verifyAccount(token)
        expect(verify.token).to.be.a('string')
      })
    })
github poetapp / frost-api / test / Integration / accounts / forgotPassword.ts View on Github external
it(`should return a message with '${errorMessages.accountNotFound}'`, async function() {
      await expect(frost.sendEmailForgotPassword('email@exist.com')).to.be.throwWith(errorMessages.accountNotFound)
    })
  })
github poetapp / frost-api / test / Integration / accounts / create.ts View on Github external
it('should return an email verified', async function() {
          await frost.create()
          const [message] = await mail.getEmails()

          expect(message.subject).to.eq('Po.et Verify account')
          expect(message.from[0].name).to.eq('Po.et')
        })
      })
github poetapp / frost-api / test / Integration / accounts / forgotPassword.ts View on Github external
it('Should not be able to log in with the old password', async function() {
        await createUserVerified(mail, frost)
        await mail.removeAll()
        await frost.sendEmailForgotPassword()
        const token = await getTokenResetPassword(mail)
        await frost.changePasswordWithToken(token, newPassword)
        await expect(frost.login(email, password)).to.be.throwWith(errorMessages.accountNotFound)
      })
    })
github poetapp / frost-api / test / Integration / tokens / create.ts View on Github external
it(`should return an error with '${errorMessages.maximumTokens}'`, async function() {
        const response = await frost.create()
        const maxTokens = 5
        for (let i = 1; i <= maxTokens - 1; i++) await frost.createApiToken(response.token, Network.TEST)

        await expect(frost.createApiToken(response.token, Network.TEST)).to.be.throwWith(errorMessages.maximumTokens)
      })
    })
github poetapp / frost-api / test / Integration / accounts / create.ts View on Github external
it(`should return an error message with 'One of the inputs is not valid...'`, async function() {
              await expect(frost.create(email, feature.value)).to.be.throwWith(errorMessages.inputsNotValid)
            })
          })
github poetapp / frost-api / test / Integration / works / getWorks.ts View on Github external
it(`Should send error message with '${errorMessages.accountIsNotVerified}'`, async function() {
        const response = await frost.create()
        const { apiToken } = await frost.createApiToken(response.token, Network.LIVE)
        await expect(frost.getWorks(apiToken)).to.be.throwWith(errorMessages.accountIsNotVerified)
      })
    })
github poetapp / frost-api / test / Integration / tokens / remove.ts View on Github external
it('should return OK', async function() {
        const { token } = await frost.create()
        const { apiTokens } = await frost.getApiTokens(token)
        const response = await frost.removeApiToken(token, apiTokens[0])
        expect(response).to.eql('OK')
      })
    })
github poetapp / frost-api / test / Integration / accounts / create.ts View on Github external
it('should return an email verified', async function() {
          await frost.create()
          const [message] = await mail.getEmails()

          expect(message.subject).to.eq('Po.et Verify account')
          expect(message.from[0].name).to.eq('Po.et')
        })
      })

expect

This package exports the `expect` function used in [Jest](https://jestjs.io/). You can find its documentation [on Jest's website](https://jestjs.io/docs/expect).

MIT
Latest version published 1 year ago

Package Health Score

88 / 100
Full package analysis