node-escpos / driver

🖨️ ESC/POS Printer driver for Node.js.
Other
287 stars 27 forks source link

fix #50: Solved removing all usb detach listeners #51

Closed dschweinbenz closed 1 year ago

dschweinbenz commented 1 year ago

Fixed #50

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 22d0348bd7abb6d8909b37185bca526407958b62

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------ | ----- | | @node-escpos/usb-adapter | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

dohooo commented 1 year ago

Cool! Thanks for your contribution! Could you add some tests for the code?

dschweinbenz commented 1 year ago

I have added some tests, hope that fits your expectations. I'll be on holiday now for some days. Would be great if this fix gets merged, as I need it in production in two weeks :)

Is there a manual somewhere how to run / use the tests inside the example/demo folder? If i run pnpm i inside the folder as well as pnpm run dev I get the following:

 FAIL  test/codepage.test.ts [ test/codepage.test.ts ]
Error: Cannot find module '/home/pi/node-escpos/examples/demo/dist/index.mjs'. Please verify that the package.json has a valid "main" entry
 ❯ test/codepage.test.ts:2:15
      1| 'use strict';
      2| const escpos = require('../');
       |               ^
      3| const path = require('path');
      4| 

Also I am wondering where the method Printer.create comes from inside example/demo/test/promise.test.ts?