From 43e93671dde5ad49256b2703070bc69706d9e82f Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 14 Feb 2021 16:30:23 +0100 Subject: [PATCH] Fix compilation for tests --- package.json | 2 +- src/listener-rss.ts | 2 +- tests/tsconfig.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2caf60c..e34514f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A lightweight library to give some additions for the [rss-parser package](https://github.com/rbren/rss-parser).", "main": "index.js", "scripts": { - "test": "mocha --require ts-node/register ./tests/**/*-spec.ts", + "test": "TS_NODE_PROJECT='./tests/tsconfig.json' mocha --require ts-node/register ./tests/**/*-spec.ts", "build": "tsc -p ./src" }, "repository": { diff --git a/src/listener-rss.ts b/src/listener-rss.ts index a092980..36e4f4f 100644 --- a/src/listener-rss.ts +++ b/src/listener-rss.ts @@ -1,4 +1,4 @@ -import * as Parser from "rss-parser/index"; +import Parser from "rss-parser/index"; import { ListenerRSSInfos as ListenerInfo } from "./Models/ListenerRSSInfos"; const DEFAULT_TIMELOOP: number = 5 * 60; // default timeloop is 5 min diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 035f11b..70ca497 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "esModuleInterop": true } }