Kurt/rw 37 upgrade (#566)

* Update readme

* Upgrade redwood to 0.37.x
This commit was merged in pull request #566.
This commit is contained in:
Kurt Hutten
2021-10-20 14:10:19 +11:00
committed by GitHub
parent e26beda598
commit 219f341972
24 changed files with 5145 additions and 5549 deletions

View File

@@ -0,0 +1,18 @@
import { mockRedwoodDirective, getDirectiveName } from '@redwoodjs/testing/api'
import requireAuth from './requireAuth'
describe('requireAuth directive', () => {
it('declares the directive sdl as schema, with the correct name', () => {
expect(requireAuth.schema).toBeTruthy()
expect(getDirectiveName(requireAuth.schema)).toBe('requireAuth')
})
it('requireAuth has stub implementation. Should not throw when current user', () => {
// If you want to set values in context, pass it through e.g.
// mockRedwoodDirective(requireAuth, { context: { currentUser: { id: 1, name: 'Lebron McGretzky' } }})
const mockExecution = mockRedwoodDirective(requireAuth, { context: {} })
expect(mockExecution).not.toThrowError()
})
})