Mxl.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { IXmlElement } from "../../../src/Common/FileIO/Xml";
  2. import { extractSheetFromMxl } from "../../../src/Common/FileIO/Mxl.ts";
  3. describe("MXL Tests", () => {
  4. // Initialize variables
  5. let path: string = "test/data/MozartTrio.mxl";
  6. // let score: IXmlElement;
  7. function getSheet(filename: string): string {
  8. console.log(((window as any).__mxl__));
  9. return ((window as any).__mxl__)[filename];
  10. }
  11. before((): void => {
  12. // Load the xml file
  13. let mxl: string = getSheet(path);
  14. chai.expect(mxl).to.not.be.undefined;
  15. extractSheetFromMxl(mxl).then(
  16. (elem: IXmlElement) => {
  17. console.log("success!", elem);
  18. },
  19. (reason: any) => {
  20. chai.assert.fail(0, 1, reason.message);
  21. }
  22. );
  23. // score = new IXmlElement(doc.getElementsByTagName("score-partwise")[0]);
  24. // // chai.expect(score).to.not.be.undefined;
  25. // sheet = reader.createMusicSheet(score, path);
  26. });
  27. it("Success", (done: MochaDone) => {
  28. chai.expect(extractSheetFromMxl).to.equal(extractSheetFromMxl);
  29. done();
  30. });
  31. });