Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

prompts.processors.string.test.ts 706 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  1. import { processString } from '../src/prompts/processors/string';
  2. import type { Prompt } from '../src/types';
  3. describe('processString', () => {
  4. it('should process a valid string prompt without a label', () => {
  5. const prompt: Partial<Prompt> = { raw: 'This is a prompt' };
  6. expect(processString(prompt)).toEqual([
  7. {
  8. raw: 'This is a prompt',
  9. label: 'This is a prompt',
  10. },
  11. ]);
  12. });
  13. it('should process a valid string prompt with a label', () => {
  14. const prompt: Partial<Prompt> = { raw: 'This is a prompt', label: 'Label' };
  15. expect(processString(prompt)).toEqual([
  16. {
  17. raw: 'This is a prompt',
  18. label: 'Label',
  19. },
  20. ]);
  21. });
  22. });
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...