Files
hasura-backend-plus/src/routes/auth/token/token.test.ts
Pilou 29b4d913d4 Clean docker and migrate (#189)
* feat: autoload migrations and simplify start script

no need to get the migrations from the migration files from the repo and to mount a specific volume
to the Hasura GE service. By default, when HBP starts, it checks the migrations and installs it if
required. This can be disabled by setting AUTO_MIGRATE to false. This system could be extended to
set AUTO_MIGRATE=v1 so it runs another set of migrations that would transform schema and data from
HBP v1 to HBP v2

* fix: include mock migrations used for testing

* fix: run migrations in a separate node script

* refactor: better general repo structure, and migration that works

* ci: change test mock migration folder in GH actions
2020-04-30 15:10:12 +02:00

21 lines
513 B
TypeScript

import 'jest-extended'
import { account, request } from '@test/test-mock-account'
it('should refresh the token', async () => {
const { body, status } = await request.post('/auth/token/refresh')
expect(status).toEqual(200)
expect(body.jwt_token).toBeString()
expect(body.jwt_expires_in).toBeNumber()
})
it('should revoke the token', async () => {
const { status } = await request
.post('/auth/token/revoke')
.set('Authorization', `Bearer ${account.token}`)
expect(status).toEqual(204)
})