-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c418a85
commit 63c870d
Showing
7 changed files
with
92 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
pnpm format:check && pnpm lint:check && pnpm test:coverage | ||
pnpm format:check && pnpm lint:check && pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
import { DequeuedMessageItem, QueueCreateIfNotExistsResponse, QueueReceiveMessageResponse } from '@azure/storage-queue' | ||
|
||
export class QueueService { | ||
readonly messages: DequeuedMessageItem[] = [ | ||
{ | ||
messageId: 'abcderhbub', | ||
insertedOn: new Date(), | ||
expiresOn: new Date(), | ||
popReceipt: '#6788888', | ||
nextVisibleOn: new Date(), | ||
dequeueCount: 0, | ||
messageText: '{"hello":"world","a":5}' | ||
}, | ||
{ | ||
messageId: 'gjhcvf', | ||
insertedOn: new Date(), | ||
expiresOn: new Date(), | ||
popReceipt: '#1234', | ||
nextVisibleOn: new Date(), | ||
dequeueCount: 0, | ||
messageText: '{"world":"hello","a":5}' | ||
} | ||
] | ||
queueMessage: DequeuedMessageItem[] = [] | ||
constructor() { | ||
this.queueMessage = this.messages | ||
} | ||
|
||
deleteMessage = (messageId: string) => { | ||
this.queueMessage = this.queueMessage.filter((message) => message.messageId != messageId) | ||
} | ||
|
||
restoreMessages = () => { | ||
this.queueMessage = this.messages | ||
} | ||
|
||
fetchMessages = (count: number): QueueReceiveMessageResponse => ({ | ||
receivedMessageItems: this.queueMessage.slice(0, Math.min(count, this.queueMessage.length)), | ||
_response: undefined, | ||
errorCode: undefined | ||
}) | ||
|
||
createQueue = (): QueueCreateIfNotExistsResponse => ({ succeeded: true, _response: undefined }) | ||
} | ||
|
||
export const flushPromises = async () => await new Promise(process.nextTick) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ export default defineConfig({ | |
exclude: ['dist/**', 'tests/**'] | ||
} | ||
} | ||
}) | ||
}) |