Reformat files using prettier

This commit is contained in:
T. R. Bernstein
2025-07-01 23:21:56 +02:00
parent b1d36437ea
commit 38f7230ce1
18 changed files with 1718 additions and 1606 deletions

View File

@@ -1,30 +1,30 @@
import fs from "fs";
import "mocha";
import should from "should";
import stream from "stream";
import zlib from "zlib";
import fs from 'fs'
import 'mocha'
import should from 'should'
import stream from 'stream'
import zlib from 'zlib'
import { XmlParser } from "../src/parser";
describe("CData and comments in xml", () => {
it("should properly parse a simple file.", (done) => {
const xmlStream = fs.createReadStream("./test/TestFiles/CData-comments.xml");
const parser = new XmlParser({ resourcePath: "/items/item" });
import { XmlParser } from '../src/parser'
describe('CData and comments in xml', () => {
it('should properly parse a simple file.', (done) => {
const xmlStream = fs.createReadStream('./test/TestFiles/CData-comments.xml')
const parser = new XmlParser({ resourcePath: '/items/item' })
let dataEventCount = 0;
let dataEventCount = 0
parser.on("data", (data) => {
dataEventCount++;
});
parser.on('data', (data) => {
dataEventCount++
})
parser.on("error", (err) => {
done(err);
});
parser.on('error', (err) => {
done(err)
})
parser.on("end", () => {
parser.on('end', () => {
// console.log('dataEventCount=', dataEventCount)
should(dataEventCount).equal(296);
done();
});
xmlStream.pipe(parser);
});
});
should(dataEventCount).equal(296)
done()
})
xmlStream.pipe(parser)
})
})