123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import { IXmlElement } from "../../../src/Common/FileIO/Xml";
- import { TestUtils } from "../../Util/TestUtils";
- import { MXLHelper } from "../../../src/Common/FileIO/Mxl";
- describe("MXL Tests", () => {
-
- function testFile(scoreName: string): void {
- it(`reads ${scoreName}`, (done: Mocha.Done) => {
-
- const mxl: string = TestUtils.getMXL(scoreName);
- chai.expect(mxl).to.not.be.undefined;
-
-
-
-
-
- MXLHelper.MXLtoIXmlElement(mxl).then(
- (score: IXmlElement) => {
- chai.expect(score).to.not.be.undefined;
- chai.expect(score.name).to.equal("score-partwise");
- done();
- },
- (exc: any) => { throw exc; }
- ).then(undefined, done);
- });
- }
-
- const scores: string[] = [
- "Mozart_Clarinet_Quintet_Excerpt.mxl",
- ];
- for (const score of scores) {
- testFile(score);
- }
-
- it("Corrupted file", (done: Mocha.Done) => {
- MXLHelper.MXLtoIXmlElement("").then(
- (score: IXmlElement) => {
- chai.expect(score).to.not.be.undefined;
- chai.expect(score.name).to.equal("score-partwise");
- done(new Error("Empty zip file was loaded correctly. How is that even possible?"));
- },
- (exc: any) => { done(); }
- );
- });
- });
|