Improve tests a little bit

This commit is contained in:
Florent
2021-03-06 17:32:59 +01:00
committed by Florent F
parent f6d98e472e
commit dd4bf59e41
2 changed files with 129 additions and 107 deletions

View File

@ -54,9 +54,7 @@ export class ListenerRss extends EventEmitter {
* @return return a promise with the received data
*/
fetchRSS(): Promise<Parser.Output<any>> {
return this.parser.parseURL(this.address).catch((err) => {
throw new Error("bad address or no access : " + err);
});
return this.parser.parseURL(this.address);
}
/**
@ -69,7 +67,7 @@ export class ListenerRss extends EventEmitter {
const fun: () => void = () => {
this.fetchRSS()
.then((obj: { [key: string]: any }) => this.emit("update", obj))
.catch((err) => this.emit("update_err", err));
.catch((err) => this.emit("error", err));
};
(async () => {