Testing
Running Tests
# Run all tests
pnpm test
# Watch mode
pnpm test -- --watch
# Coverage report
pnpm test:coverageTest Structure
test/
├── metadata.test.ts # Metadata generation tests
├── pumpfun.test.ts # PDA derivation tests
└── api.test.ts # API endpoint testsExample Test
// test/metadata.test.ts
import { describe, it, expect } from 'vitest';
import { generateMetadata } from '../src/lib/metadata';
describe('Metadata Generation', () => {
it('generates valid token name', () => {
const metadata = generateMetadata({ username: 'cryptofan' } as any);
expect(metadata.name).toBe('WP_CRYPTOFAN');
expect(metadata.name.length).toBeLessThanOrEqual(32);
});
it('handles special characters', () => {
const metadata = generateMetadata({ username: 'crypto_fan!' } as any);
expect(metadata.name).toBe('WP_CRYPTOFAN');
});
});Testing Without Real Launches
This lets you test detection and processing without creating real tokens.
