mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 22:14:27 +00:00
🔤 test: Cover Alias Frontmatter Keys in the Skill Sync Skip (#16725)
* test: Cover Alias Frontmatter Keys in the Skill Sync Skip * test: Assert the Alias Frontmatter Rerun Succeeds Without Skips
This commit is contained in:
parent
3dd0d06796
commit
bee202e9f5
1 changed files with 27 additions and 0 deletions
|
|
@ -3900,6 +3900,33 @@ describe('steady-state sync of an unchanged source', () => {
|
|||
expect((await getMirror()).version).toBe(before.version);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['canonical', 'always-apply: true'],
|
||||
['camelCase alias', 'alwaysApply: true'],
|
||||
['both spellings', 'always-apply: true\nalwaysApply: true'],
|
||||
['placeholder canonical with alias', 'always-apply:\nalwaysApply: false'],
|
||||
['placeholder alias with canonical', 'always-apply: false\nalwaysApply:'],
|
||||
['mixed-case', 'Always-Apply: true\nAllowed-Tools: [Read]\nLicense: MIT'],
|
||||
])('skips an unchanged skill whose frontmatter uses %s keys', async (_label, frontmatter) => {
|
||||
const repo = createRepo({
|
||||
'skills/research/SKILL.md': {
|
||||
content: `---\nname: research\ndescription: Research things\n${frontmatter}\n---\nBody`,
|
||||
},
|
||||
});
|
||||
await seed(repo);
|
||||
const before = await getMirror();
|
||||
|
||||
const deps = createDbDeps(repo);
|
||||
const result = await createGitHubSkillSyncRunner(deps).runOnce();
|
||||
|
||||
expect(result.sources[0]).toEqual(
|
||||
expect.objectContaining({ status: 'succeeded', syncedSkillCount: 1, skippedSkillCount: 0 }),
|
||||
);
|
||||
expect(repo.fetchFileContent).not.toHaveBeenCalled();
|
||||
expect(deps.updateSkill).not.toHaveBeenCalled();
|
||||
expect((await getMirror()).version).toBe(before.version);
|
||||
});
|
||||
|
||||
it('downloads SKILL.md and updates the skill when its blob changes', async () => {
|
||||
const repo = createRepo(baseRepo());
|
||||
await seed(repo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue