const { post, ensureOk } = require('./common');

async function run() {
  const data = await post('/api/print', {
    operations: [
      { op: 'textAlign', align: 'center' },
      { op: 'text', value: 'Test 5: EAN13' },
      { op: 'feedLine', line: 1 },
      { op: 'barcode', data: '490123456789', type: 'ean13', hri: 'below', width: 3, height: 80 },
      { op: 'feedLine', line: 2 }
    ]
  });
  console.log('05_barcode ->', data);
  ensureOk(data, '05_barcode');
}

if (require.main === module) {
  run().catch((e) => { console.error(e.message); process.exit(1); });
}

module.exports = run;

