Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ backup/
# Plugins build outputs
plugins/*/dist/

# Secrets API_KEYS
# Secrets API Keys
.env
8 changes: 4 additions & 4 deletions scripts/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>;
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<string, unknown>;
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<string, unknown>;
assert.ok(typeof obj.instructions === 'string');
assert.ok((obj.instructions as string).includes('Copier-coller'));
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class PromptorPlugin implements IPlugin {
/**
* Exécution : affiche la matrice pour l'utilisateur
*/
async execute(input: unknown): Promise<unknown> {
async execute(input: unknown): Promise<{ success: boolean; matrix: string; instructions: string }> {
await this.initialize();

// En-tête
Expand All @@ -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é'
};
}
Expand Down
Loading