mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
feat: 拓展中心加入机器人
This commit is contained in:
1 parent
4eaddc2d75
commit
a81b3733fa
31 files changed
+3510
-566
No files matched your search
@@ -3,12 +3,7 @@ import path from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { ExtensionTemplateCatalog } from '../../src/main/extensions/extension-template-catalog'
|
||||
|
||||
/**
|
||||
* 打包产物验证:只读 `Resources/extension-templates`,不碰源码树。
|
||||
*
|
||||
* 这一步回答的是「删掉 examples 之后用户还能不能看到模板」——如果目录不存在
|
||||
* (例如只跑了单元测试),整组跳过,不影响常规 CI。
|
||||
*/
|
||||
/** 打包产物验证:只读 `Resources/extension-templates`,不碰源码树。 */
|
||||
const CANDIDATES = [
|
||||
'dist/mac-arm64/TraceMemo.app/Contents/Resources/extension-templates',
|
||||
'dist/mac/TraceMemo.app/Contents/Resources/extension-templates',
|
||||
@@ -21,7 +16,7 @@ const packagedRoot = CANDIDATES.map((relative) => path.join(process.cwd(), relat
|
||||
)
|
||||
|
||||
describe.skipIf(!packagedRoot)('打包后的模板资源', () => {
|
||||
it('产物目录自带两个模板与索引', async () => {
|
||||
it('产物目录自带三个模板与索引', async () => {
|
||||
const catalog = new ExtensionTemplateCatalog({
|
||||
templateRoot: packagedRoot as string,
|
||||
getRecord: () => undefined,
|
||||
@@ -34,6 +29,7 @@ describe.skipIf(!packagedRoot)('打包后的模板资源', () => {
|
||||
const list = await catalog.list()
|
||||
expect(list.map((item) => item.template.templateId).sort()).toEqual([
|
||||
'douyin-sender',
|
||||
'group-chat-bot',
|
||||
'keyword-bot'
|
||||
])
|
||||
// 资源自包含:索引里的 zip 就在同一目录,且哈希匹配(damaged 会暴露不一致)。
|
||||
@@ -49,7 +45,7 @@ describe.skipIf(!packagedRoot)('打包后的模板资源', () => {
|
||||
probePython: () => '/usr/bin/python3',
|
||||
probeChrome: () => '/usr/bin/chrome'
|
||||
})
|
||||
for (const templateId of ['keyword-bot', 'douyin-sender']) {
|
||||
for (const templateId of ['keyword-bot', 'group-chat-bot', 'douyin-sender']) {
|
||||
const resolved = await catalog.resolveZip(templateId)
|
||||
expect(fs.existsSync(resolved.path)).toBe(true)
|
||||
expect(resolved.template.sha256).toMatch(/^[a-f0-9]{64}$/)
|
||||
|
||||
Reference in new issue
Block a user