generated from ubiquity-os/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from gentlementlegen/fix/start-message
fix: a start message saying the bot is "thinking" is displayed
- Loading branch information
Showing
15 changed files
with
2,553 additions
and
43 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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit "$1" | ||
bun commitlint --edit "$1" |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint-staged | ||
bun lint-staged |
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 |
---|---|---|
|
@@ -41,5 +41,5 @@ UBIQUITY_OS_APP_NAME="UbiquityOS" | |
## Testing | ||
|
||
```sh | ||
yarn test | ||
bun run test | ||
``` |
Large diffs are not rendered by default.
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
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 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 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { jest } from "@jest/globals"; | ||
import { Logs } from "@ubiquity-os/ubiquity-os-logger"; | ||
|
||
describe("Log post message test", () => { | ||
it("Should post a waiting message on start", async () => { | ||
const addCommentToIssue = jest.fn(); | ||
jest.unstable_mockModule("../src/handlers/add-comment", () => ({ | ||
addCommentToIssue, | ||
})); | ||
jest.unstable_mockModule("../src/handlers/ask-llm", () => ({ | ||
askQuestion: jest.fn(() => ({ | ||
answer: "hello", | ||
tokenUsage: 1, | ||
groundThreshold: [], | ||
})), | ||
})); | ||
const { processCommentCallback } = await import("../src/handlers/comment-created-callback"); | ||
const context = { | ||
payload: { | ||
comment: { | ||
user: { | ||
type: "User", | ||
}, | ||
body: "/ask hello", | ||
}, | ||
}, | ||
logger: new Logs("debug"), | ||
env: { | ||
UBIQUITY_OS_APP_NAME: "UbiquityOS", | ||
}, | ||
} as never; | ||
|
||
await processCommentCallback(context); | ||
expect(addCommentToIssue).toHaveBeenCalledWith(expect.anything(), "UbiquityOS is thinking..."); | ||
}); | ||
}); |
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