From fa1891994a62daca324425a4639b40981d55bba9 Mon Sep 17 00:00:00 2001 From: Rory Mulligan Date: Fri, 25 Oct 2019 09:18:34 -0400 Subject: [PATCH 1/2] Adding glob for spec files as unit tests --- src/unit.config.ts | 2 +- test-app/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unit.config.ts b/src/unit.config.ts index abb0b045..9dd3b601 100644 --- a/src/unit.config.ts +++ b/src/unit.config.ts @@ -12,7 +12,7 @@ function webpackConfig(args: any): webpack.Configuration { const outputPath = output!.path as string; config.entry = () => { const unit = globby - .sync([`${basePath}/tests/unit/**/*.ts`]) + .sync([`${basePath}/tests/unit/**/*.ts`, `${basePath}/src/**/*.spec.{ts,tsx}`]) .map((filename: string) => filename.replace(/\.ts$/, '')); const tests: any = {}; diff --git a/test-app/package.json b/test-app/package.json index d41558e9..b5fe0b4d 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -13,7 +13,7 @@ "build:dev:pwa": "dojo build --dojorc .dojorc-dev-pwa", "build:dist:pwa:evergreen": "dojo build --dojorc .dojorc-dist-pwa-evergreen", "build:dev:pwa:evergreen": "dojo build --dojorc .dojorc-dev-pwa-evergreen", - "build:test": "dojo build --mode test" + "build:test": "dojo build --mode unit" }, "author": "", "license": "ISC", From e0e90a5ac3eaec9c4b67c15832cc5029df45bf00 Mon Sep 17 00:00:00 2001 From: Rory Mulligan Date: Fri, 25 Oct 2019 09:39:42 -0400 Subject: [PATCH 2/2] Adding TSX to unit glob --- src/unit.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unit.config.ts b/src/unit.config.ts index 9dd3b601..eb869d26 100644 --- a/src/unit.config.ts +++ b/src/unit.config.ts @@ -12,7 +12,7 @@ function webpackConfig(args: any): webpack.Configuration { const outputPath = output!.path as string; config.entry = () => { const unit = globby - .sync([`${basePath}/tests/unit/**/*.ts`, `${basePath}/src/**/*.spec.{ts,tsx}`]) + .sync([`${basePath}/tests/unit/**/*.{ts,tsx}`, `${basePath}/src/**/*.spec.{ts,tsx}`]) .map((filename: string) => filename.replace(/\.ts$/, '')); const tests: any = {};