Skip to content

Commit

Permalink
feat: implement route to get print - format pairs and route to print …
Browse files Browse the repository at this point in the history
…with printer-format selection and data to interpolate
  • Loading branch information
stropitek committed Oct 22, 2021
1 parent 049d6cf commit a4224a1
Show file tree
Hide file tree
Showing 16 changed files with 562 additions and 348 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"arrowParens": "always",
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all"
}
126 changes: 113 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"license": "MIT",
"dependencies": {
"@sinclair/typebox": "^0.20.5",
"@types/twig": "^1.12.6",
"body-parser": "^1.19.0",
"fastify": "^3.22.1",
"fastify-cors": "^6.0.2",
"rest-on-couch-client": "^3.3.1",
"superagent": "^6.1.0"
"superagent": "^6.1.0",
"twig": "^1.15.4"
},
"scripts": {
"build": "tsc",
Expand Down
38 changes: 19 additions & 19 deletions src/__tests__/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parsePrinterResponse } from "../util";
import { parsePrinterResponse } from '../util';

const german = `
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Expand Down Expand Up @@ -96,26 +96,26 @@ Support: <A HREF="https://www.zebra.com/support.html">https://www.zebra.com/supp
</HTML>
`;

test("parse printer result (german)", () => {
const parsed = parsePrinterResponse(german);
expect(parsed).toMatchObject({
isOnline: true,
serialNumber: "vad-zebra1-la",
});
test('parse printer result (german)', () => {
const parsed = parsePrinterResponse(german);
expect(parsed).toMatchObject({
isOnline: true,
serialNumber: 'vad-zebra1-la',
});
});

test("parse printer result (english)", () => {
const parsed = parsePrinterResponse(english);
expect(parsed).toMatchObject({
isOnline: true,
serialNumber: "ACI-PRT10",
});
test('parse printer result (english)', () => {
const parsed = parsePrinterResponse(english);
expect(parsed).toMatchObject({
isOnline: true,
serialNumber: 'ACI-PRT10',
});
});

test("parse printer result not ready", () => {
const parsed = parsePrinterResponse(englishError);
expect(parsed).toMatchObject({
isOnline: false,
serialNumber: "ACI-PRT10",
});
test('parse printer result not ready', () => {
const parsed = parsePrinterResponse(englishError);
expect(parsed).toMatchObject({
isOnline: false,
serialNumber: 'ACI-PRT10',
});
});
Loading

0 comments on commit a4224a1

Please sign in to comment.