Skip to content

Commit f857c3b

Browse files
authored
fix: resolve deserialization error in PromptorPlugin test runner (#17)
* Update README.md * Update README.md * chore: update tests pass 37/37 #v2.2.1 * Ajout .env dans .gitignore * Delete .env * fix: resolve deserialization error in PromptorPlugin test runner * fix: force sequential test execution to prevent IPC deserialization errors in CI
1 parent cf90196 commit f857c3b

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ backup/
4646
# Plugins build outputs
4747
plugins/*/dist/
4848

49-
# Secrets API_KEYS
49+
# Secrets API Keys
5050
.env

scripts/node/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "promptops.js",
66
"type": "module",
77
"scripts": {
8-
"test": "tsx --test --test-reporter=spec \"**/*.test.ts\"",
9-
"test:unit": "tsx --test --test-reporter=spec \"plugins/**/*.test.ts\"",
10-
"test:integration": "tsx --test --test-reporter=spec \"tests/integration/**/*.test.ts\"",
11-
"test:all": "tsx --test --test-reporter=spec \"**/*.test.ts\"",
8+
"test": "tsx --test --test-concurrency=1 --test-reporter=spec \"**/*.test.ts\"",
9+
"test:unit": "tsx --test --test-concurrency=1 --test-reporter=spec \"plugins/**/*.test.ts\"",
10+
"test:integration": "tsx --test --test-concurrency=1 --test-reporter=spec \"tests/integration/**/*.test.ts\"",
11+
"test:all": "tsx --test --test-concurrency=1 --test-reporter=spec \"**/*.test.ts\"",
1212
"test:watch": "tsx --test --watch \"**/*.test.ts\"",
1313
"lint": "echo 'No linting configured'",
1414
"build": "tsc",

scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,23 @@ describe('PromptorPlugin', () => {
5151
it('should return success result', async () => {
5252
const result = await plugin.execute({});
5353
assert.ok(typeof result === 'object');
54-
assert.strictEqual((result as any).success, true);
54+
assert.ok(result !== null);
55+
const obj = result as Record<string, unknown>;
56+
assert.strictEqual(obj.success, true);
5557
});
5658

5759
it('should return matrix in result', async () => {
5860
const result = await plugin.execute({});
59-
assert.ok((result as any).matrix?.length > 0);
61+
const obj = result as Record<string, unknown>;
62+
assert.ok(typeof obj.matrix === 'string');
63+
assert.ok((obj.matrix as string).length > 0);
6064
});
6165

6266
it('should return instructions in result', async () => {
6367
const result = await plugin.execute({});
64-
assert.ok((result as any).instructions?.includes('Copier-coller'));
68+
const obj = result as Record<string, unknown>;
69+
assert.ok(typeof obj.instructions === 'string');
70+
assert.ok((obj.instructions as string).includes('Copier-coller'));
6571
});
6672
});
6773

scripts/node/plugins/builtins/promptor-matrix/PromptorPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class PromptorPlugin implements IPlugin {
3232
/**
3333
* Exécution : affiche la matrice pour l'utilisateur
3434
*/
35-
async execute(input: unknown): Promise<unknown> {
35+
async execute(input: unknown): Promise<{ success: boolean; matrix: string; instructions: string }> {
3636
await this.initialize();
3737

3838
// En-tête
@@ -55,7 +55,7 @@ export class PromptorPlugin implements IPlugin {
5555

5656
return {
5757
success: true,
58-
matrix: this.matrix,
58+
matrix: String(this.matrix),
5959
instructions: 'Copier-coller dans ton LLM préféré'
6060
};
6161
}

0 commit comments

Comments
 (0)