File tree Expand file tree Collapse file tree
plugins/builtins/promptor-matrix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,5 +46,5 @@ backup/
4646# Plugins build outputs
4747plugins /* /dist /
4848
49- # Secrets API_KEYS
49+ # Secrets API Keys
5050.env
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments