Unit tests not working after upgrade to angular 5 and mdb pr


Topic: Unit tests not working after upgrade to angular 5 and mdb pro 5.1.2

ADS@Aareon pro asked 7 years ago

I just upgraded my project to angular 5.2.1 and mdb pro 5.1.2 (master branch) I added the include to the tsconfig.json "include": ["node_modules/ng-mdb-pro/**/*.ts", "src/**/*.ts"]   ng serve and ng build (angular-cli) is working fine, but when i run the tests with ng test i get the following errors: ERROR in ./node_modules/ng-mdb-pro/free/index.ts Module build failed: Error: D:ReposADS...node_modulesng-mdb-profreeindex.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:ReposADS...node_modules@ngtoolswebpacksrcangular_compiler_plugin.js:662:23) at plugin.done.then (D:ReposADS...node_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/app.component.ts 17:13-39 @ ./src/app/app.component.spec.ts @ ./src .spec.ts$ @ ./src/test.ts ERROR in ./node_modules/ng-mdb-pro/index.ts Module build failed: Error: D:ReposADS...node_modulesng-mdb-proindex.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:ReposADS...node_modules@ngtoolswebpacksrcangular_compiler_plugin.js:662:23) at plugin.done.then (D:ReposADS...node_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/shared/shared.module.ts 14:19-40 @ ./src/app/app.component.spec.ts @ ./src .spec.ts$ @ ./src/test.ts ERROR in ./node_modules/ng-mdb-pro/mdb.module.ts Module build failed: Error: D:ReposADS...node_modulesng-mdb-promdb.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:ReposADS...node_modules@ngtoolswebpacksrcangular_compiler_plugin.js:662:23) at plugin.done.then (D:ReposADS...node_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/core/core.module.ts 21:19-51 @ ./src/app/app.component.spec.ts @ ./src .spec.ts$ @ ./src/test.ts ERROR in ./node_modules/ng-mdb-pro/pro/alerts/index.ts Module build failed: Error: D:ReposADS...node_modulesng-mdb-proproalertsindex.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:ReposADS...node_modules@ngtoolswebpacksrcangular_compiler_plugin.js:662:23) at plugin.done.then (D:ReposADS...node_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/core/error-handler/error-popup/error-popup.component.spec.ts 9:15-47 @ ./src .spec.ts$ @ ./src/test.ts ERROR in ./node_modules/ng-mdb-pro/pro/index.ts Module build failed: Error: D:ReposADS...node_modulesng-mdb-proproindex.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (D:ReposADS...node_modules@ngtoolswebpacksrcangular_compiler_plugin.js:662:23) at plugin.done.then (D:ReposADS...node_modules@ngtoolswebpacksrcloader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/core/core.module.ts 22:12-37 @ ./src/app/app.component.spec.ts @ ./src .spec.ts$ @ ./src/test.ts Kind regards, Richard

Dawid Adach pro answered 7 years ago

Dear ADS@Aareon Similarly to tsconfig.js file , you should add index.ts to your compilation path in tsconfig.spec.json  file:
"include": [
"**/*.spec.ts",
"**/*.d.ts",
"../node_modules/ng-mdb-pro/**/*.ts"
]

ADS@Aareon pro commented 7 years ago

Hello David, I actually tried that, but i used the wrong path :) "node_modules/ng-mdb-pro/**/*.ts" in stead of "../node_modules/ng-mdb-pro/**/*.ts" Its working now. Thank you for your support, Richard

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No