Skip to content

Commit 4369b12

Browse files
committed
Fixes
1 parent 7d32565 commit 4369b12

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/ai/integration/constants.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ export const liveTestConfigs: readonly TestConfig[] = backends.flatMap(
100100
* do not define a model string.
101101
* These tests should only run once per backend, rather than once per backend *per model*.
102102
*/
103-
export const promptTemplatesTestConfigs: readonly TestConfig[] = backends.flatMap(backend => {
104-
const ai = getAI(app, { backend });
105-
return {
106-
ai,
107-
model: '', // Unused by prompt templates tests
108-
toString: () => formatConfigAsString({ ai, model: '' })
109-
};
110-
});
103+
export const promptTemplatesTestConfigs: readonly TestConfig[] =
104+
backends.flatMap(backend => {
105+
const ai = getAI(app, { backend });
106+
return {
107+
ai,
108+
model: '', // Unused by prompt templates tests
109+
toString: () => formatConfigAsString({ ai, model: '' }).trim()
110+
};
111+
});
111112

112113
export const TINY_IMG_BASE64 =
113114
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=';

packages/ai/integration/prompt-templates.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const templateBackendSuffix = (
3131
describe('Prompt templates', function () {
3232
this.timeout(20_000);
3333
promptTemplatesTestConfigs.forEach(testConfig => {
34-
describe(`${promptTemplatesTestConfigs.toString()}`, () => {
34+
describe(`${testConfig.toString()}`, () => {
3535
describe('Generative Model', () => {
3636
it('successfully generates content', async () => {
3737
const model = getTemplateGenerativeModel(testConfig.ai);
@@ -53,7 +53,7 @@ describe('Prompt templates', function () {
5353
)}`,
5454
{ animal: 'Rhino' }
5555
);
56-
expect(images.length).to.equal(1); // We ask for two images in the prompt template
56+
expect(images.length).to.equal(1); // The template is configured to generate one image.
5757
});
5858
});
5959
});

0 commit comments

Comments
 (0)