mirror of
https://github.com/garrytan/gbrain.git
synced 2026-08-14 08:53:22 +00:00
Wave-assembled from PR #3888 by @RerankerGuo. Conflict resolution: KEY_FILES.md check-resolvable/skill-frontmatter/skill-trigger-index entries taken as the PR's current-state prose; the PR's stale pre-fold 'doctor.ts extension' entry dropped (master already folded it into the main doctor entry). Co-Authored-By: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com>
This commit is contained in:
committed by
Sina Matian
co-authored by
RerankerGuo
parent
1243a7d3bb
commit
136fc109c1
@@ -214,6 +214,38 @@ describe("extractTriggers", () => {
|
||||
expect(triggers).toEqual(["what do we know", "tell me about"]);
|
||||
});
|
||||
|
||||
test("parses triggers from a single-line YAML flow sequence", () => {
|
||||
const fm = [
|
||||
"---",
|
||||
"name: transcript-insights",
|
||||
'triggers: ["analyze this transcript", podcast takeaways]',
|
||||
"---",
|
||||
"",
|
||||
].join("\n");
|
||||
expect(extractTriggers(fm)).toEqual([
|
||||
"analyze this transcript",
|
||||
"podcast takeaways",
|
||||
]);
|
||||
});
|
||||
|
||||
test("parses triggers from a wrapped YAML flow sequence (#3887)", () => {
|
||||
const fm = [
|
||||
"---",
|
||||
"name: transcript-insights",
|
||||
"triggers: [analyze this transcript, podcast takeaways, video transcript insights, interview",
|
||||
" takeaways, policy mechanisms from transcript]",
|
||||
"---",
|
||||
"",
|
||||
].join("\n");
|
||||
expect(extractTriggers(fm)).toEqual([
|
||||
"analyze this transcript",
|
||||
"podcast takeaways",
|
||||
"video transcript insights",
|
||||
"interview takeaways",
|
||||
"policy mechanisms from transcript",
|
||||
]);
|
||||
});
|
||||
|
||||
test("returns [] when frontmatter is missing", () => {
|
||||
expect(extractTriggers("# Just a body, no frontmatter\n")).toEqual([]);
|
||||
});
|
||||
@@ -450,4 +482,3 @@ function afterEachCleanup(fn: () => void) {
|
||||
const { afterEach } = require("bun:test");
|
||||
afterEach(fn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user