Skip to content
Snippets Groups Projects

Add tests

Merged Jan Loewe requested to merge feat-jest-tests into master
3 files
+ 242
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 27
0
/**
* @jest-environment ./tests/XMLEnvironment.ts
* @xml ./tests/resources/GP_Temperature_Complete_DCC.xml
*/
import * as fc from "fast-check";
import { indexOf, select, toTextArr, toTextContentArr } from "../util";
import { CoreDataType, DCCDocument, DCCXMLElement } from "../../src";
import { string_ISO639_1 } from "../Arbitraries";
const base = "//dcc:quantity[@refType='test_charsXMLList']";
const xpath = {
charsXMLList: `string(${base}/dcc:charsXMLList)`,
};
describe("CharsXMLList", () => {
let dcc: DCCDocument, dom, result;
beforeEach(async () => {
({ dcc, dom } = await xmlEnv.recreateEnv());
result = dcc.digitalCalibrationCertificate.measurementResults.measurementResult[0].results.result[0];
});
test("should get correct charsXMLList from XML", () => {
expect(result.data.quantity[1].charsXMLList._text).toBe(select(xpath.charsXMLList, dom));
});
});
Loading