diff --git a/test/test.js b/test/test.js index 203c71e..90bdd1c 100644 --- a/test/test.js +++ b/test/test.js @@ -9,6 +9,9 @@ const portString = "/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge const buildPath = path.join(__dirname, "lora32", "build"); +const TB_DEV1 = process.env.TB_DEV1 || "0000"; +const TB_DEV2 = process.env.TB_DEV2 || "0001"; + var args = [ "--chip", "esp32", @@ -105,20 +108,20 @@ async.series([ async.parallel([ function(done) { - flash(portString.replace("SERIAL_ID", "0001"), done); + flash(portString.replace("SERIAL_ID", TB_DEV1), done); }, function(done) { - flash(portString.replace("SERIAL_ID", "0002"), done); + flash(portString.replace("SERIAL_ID", TB_DEV2), done); }], next); }, function(next) { async.parallel({ dev1: function(done) { - serial(portString.replace("SERIAL_ID", "0001"), done); + serial(portString.replace("SERIAL_ID", TB_DEV1), done); }, dev2: function(done) { - serial(portString.replace("SERIAL_ID", "0002"), done); + serial(portString.replace("SERIAL_ID", TB_DEV2), done); } }, next); }