24 lines
607 B
JavaScript
24 lines
607 B
JavaScript
/**
|
|
* 简单测试卡号生成
|
|
*/
|
|
const {CardGeneratorTool} = require('./src/tools/card/CardGeneratorTool');
|
|
|
|
async function test() {
|
|
console.log('开始测试...');
|
|
|
|
const cardGen = new CardGeneratorTool();
|
|
await cardGen.initialize({});
|
|
|
|
console.log('生成10张测试卡...\n');
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
const card = await cardGen.generate('unionpay');
|
|
console.log(`${i + 1}. ${card.number} (${card.month}/${card.year}) - ${card.issuer}-${card.cvv}`);
|
|
}
|
|
}
|
|
|
|
test().catch(err => {
|
|
console.error('错误:', err.message);
|
|
console.error(err.stack);
|
|
});
|