Initial commit: Epson ePOS Node backend + Vue3 UI (printer matricial2)

This commit is contained in:
2025-09-27 16:06:57 -06:00
commit f3c13b356b
26 changed files with 5015 additions and 0 deletions

19
scripts/tests/common.js Normal file
View File

@@ -0,0 +1,19 @@
const axios = require('axios');
const baseURL = process.env.TEST_BASE_URL || 'http://localhost:3000';
const client = axios.create({ baseURL, timeout: 120000 });
async function post(path, body) {
const res = await client.post(path, body);
return res.data;
}
function ensureOk(data, stepName) {
if (!data || data.ok !== true) {
const msg = `Printer did not confirm success on step: ${stepName} -> ${JSON.stringify(data)}`;
throw new Error(msg);
}
}
module.exports = { post, ensureOk };