From b0c36821d1dcf362f14c99ca3741e7d03aea0a04 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Tue, 4 Sep 2018 11:01:54 +0200 Subject: Add video recomandation by tags (#1001) * Recommendation by tags (thx bradsk88) Thx bradsk88 for the help. * Prefer jest-preset-angular to skip need for babel config * Fix jest --- client/package.json | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'client/package.json') diff --git a/client/package.json b/client/package.json index 12da38175..8426216bb 100644 --- a/client/package.json +++ b/client/package.json @@ -21,7 +21,7 @@ "webpack-bundle-analyzer": "webpack-bundle-analyzer", "webdriver-manager": "webdriver-manager", "ngx-extractor": "ngx-extractor", - "test": "jest" + "test": "jest --no-cache" }, "license": "GPLv3", "typings": "*.d.ts", @@ -31,13 +31,23 @@ "simple-get": "^2.8.1" }, "jest": { + "globals": { + "ts-jest": { + "tsConfigFile": "/src/tsconfig.spec.json" + }, + "__TRANSFORM_HTML__": true + }, "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.(ts|js|html)$": "/node_modules/jest-preset-angular/preprocessor.js" }, "moduleNameMapper": { - "^@app/(.*)": "/src/app/$1" + "^@app/(.*)": "/src/app/$1", + "environments/(.*)": "/src/environments/$1" }, - "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", + "testMatch": [ + "**/__tests__/**/*.+(ts|js)?(x)", + "**/+(*.)+(spec|test).+(ts|js)?(x)" + ], "moduleFileExtensions": [ "ts", "tsx", @@ -45,7 +55,12 @@ "jsx", "json", "node" - ] + ], + "transformIgnorePatterns": [ + "/node_modules/(?!lodash-es/)" + ], + "preset": "jest-preset-angular", + "setupTestFrameworkScriptFile": "/src/setupJest.ts" }, "devDependencies": { "@angular-devkit/build-angular": "^0.7.5", @@ -99,6 +114,7 @@ "jasmine-core": "^3.1.0", "jasmine-spec-reporter": "^4.2.1", "jest": "^23.5.0", + "jest-preset-angular": "^6.0.0", "jschannel": "^1.0.2", "karma": "^3.0.0", "karma-chrome-launcher": "^2.2.0", -- cgit v1.2.3