Spaces:
Sleeping
Sleeping
| const { getNextToken } = require('./executor'); | |
| // Test token rotation | |
| function testTokenRotation() { | |
| console.log('Testing token rotation...'); | |
| // Test with multiple tokens | |
| const config = { | |
| token: 'token1, token2, token3' | |
| }; | |
| console.log('Testing with tokens:', config.token); | |
| // Get tokens multiple times to test rotation | |
| for (let i = 0; i < 10; i++) { | |
| const { token, index, total } = getNextToken(config); | |
| console.log(`Request ${i+1}: Using token: ${token} (Key: ${index+1}/${total})`); | |
| } | |
| // Test with single token | |
| const singleTokenConfig = { | |
| token: 'single-token' | |
| }; | |
| console.log('\nTesting with single token:', singleTokenConfig.token); | |
| for (let i = 0; i < 3; i++) { | |
| const { token, index, total } = getNextToken(singleTokenConfig); | |
| console.log(`Request ${i+1}: Using token: ${token} (Key: ${index+1}/${total})`); | |
| } | |
| // Test with empty token | |
| const emptyTokenConfig = { | |
| token: '' | |
| }; | |
| console.log('\nTesting with empty token:'); | |
| const { token, index, total } = getNextToken(emptyTokenConfig); | |
| console.log(`Using token: ${token} (Key: ${index+1}/${total})`); | |
| } | |
| testTokenRotation(); | |