-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: delete api token handler test #1499
Conversation
import { DeleteApiTokenCommandHandler } from './delete-api-token.command.handler' | ||
import { None, Some } from 'oxide.ts' | ||
|
||
describe('APITokenStrategy', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe('APITokenStrategy', () => { | |
describe('test DeleteApiTokenCommandHandler', () => { |
userId = new UserId('user123') | ||
}) | ||
test('Delete api token success', async () => { | ||
cls.get.calledWith('user.userId').mockReturnValue('user123') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cls 和 repo 所有的 mock 都应该放在 beforeEach 里面
}) | ||
test('Delete api token success', async () => { | ||
cls.get.calledWith('user.userId').mockReturnValue('user123') | ||
apiToken.userId = userId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
常量的声明不用放这里,也不要放beforeEach,你可以直接在最外层的作用域 const
beeb5a1
to
45364e1
Compare
No description provided.