diff --git a/.gitignore b/.gitignore index f89d013..aad11bf 100644 --- a/.gitignore +++ b/.gitignore @@ -46,5 +46,5 @@ backup/ # Plugins build outputs plugins/*/dist/ -# Secrets API_KEYS +# Secrets API Keys .env diff --git a/scripts/node/package.json b/scripts/node/package.json index dabd41a..9cecc3b 100644 --- a/scripts/node/package.json +++ b/scripts/node/package.json @@ -5,10 +5,10 @@ "main": "promptops.js", "type": "module", "scripts": { - "test": "tsx --test --test-reporter=spec \"**/*.test.ts\"", - "test:unit": "tsx --test --test-reporter=spec \"plugins/**/*.test.ts\"", - "test:integration": "tsx --test --test-reporter=spec \"tests/integration/**/*.test.ts\"", - "test:all": "tsx --test --test-reporter=spec \"**/*.test.ts\"", + "test": "tsx --test --test-concurrency=1 --test-reporter=spec \"**/*.test.ts\"", + "test:unit": "tsx --test --test-concurrency=1 --test-reporter=spec \"plugins/**/*.test.ts\"", + "test:integration": "tsx --test --test-concurrency=1 --test-reporter=spec \"tests/integration/**/*.test.ts\"", + "test:all": "tsx --test --test-concurrency=1 --test-reporter=spec \"**/*.test.ts\"", "test:watch": "tsx --test --watch \"**/*.test.ts\"", "lint": "echo 'No linting configured'", "build": "tsc", diff --git a/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.test.ts b/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.test.ts index 594eda5..1c1de58 100644 --- a/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.test.ts +++ b/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.test.ts @@ -51,17 +51,23 @@ describe('PromptorPlugin', () => { it('should return success result', async () => { const result = await plugin.execute({}); assert.ok(typeof result === 'object'); - assert.strictEqual((result as any).success, true); + assert.ok(result !== null); + const obj = result as Record; + assert.strictEqual(obj.success, true); }); it('should return matrix in result', async () => { const result = await plugin.execute({}); - assert.ok((result as any).matrix?.length > 0); + const obj = result as Record; + assert.ok(typeof obj.matrix === 'string'); + assert.ok((obj.matrix as string).length > 0); }); it('should return instructions in result', async () => { const result = await plugin.execute({}); - assert.ok((result as any).instructions?.includes('Copier-coller')); + const obj = result as Record; + assert.ok(typeof obj.instructions === 'string'); + assert.ok((obj.instructions as string).includes('Copier-coller')); }); }); diff --git a/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.ts b/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.ts index 0831ef4..752d240 100644 --- a/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.ts +++ b/scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.ts @@ -32,7 +32,7 @@ export class PromptorPlugin implements IPlugin { /** * Exécution : affiche la matrice pour l'utilisateur */ - async execute(input: unknown): Promise { + async execute(input: unknown): Promise<{ success: boolean; matrix: string; instructions: string }> { await this.initialize(); // En-tête @@ -55,7 +55,7 @@ export class PromptorPlugin implements IPlugin { return { success: true, - matrix: this.matrix, + matrix: String(this.matrix), instructions: 'Copier-coller dans ton LLM préféré' }; }