79254371

Date: 2024-12-05 11:03:58
Score: 2
Natty:
Report link

UPDATE 2

After update my karma.conf.js file like this :

 preprocessors: {
      'src/app/**/*.spec.ts': ['webpack'],
      'src/**/*.js': ['webpack']
    },

webpack preprocess test files but now I have an error related to the loader :

    ERROR in ./src/app/app.component.spec.ts 17:13
Module parse failed: Unexpected token (17:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| describe('AppComponent', () => {
| 
>   let fixture: ComponentFixture<AppComponent>;
|   let modalService: NgbModal;
|   let modalRef: NgbModalRef; 

ERROR in ./src/app/email-checker-api.service.spec.ts 7:13
Module parse failed: Unexpected token (7:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| 
| describe('EmailCheckerApiService', () => {
>   let service: EmailCheckerApiService;
| 
|   beforeEach(() => {

ERROR in ./src/app/email.service.spec.ts 8:13
Module parse failed: Unexpected token (8:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| 
| describe('EmailService', () => {
>   let service: EmailService;
| 
|   beforeEach(() => {

ERROR in ./src/app/form/form.component.spec.ts 9:15
Module parse failed: Unexpected token (9:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| 
| describe('FormComponent', () => {
>   let component: FormComponent;
|   let fixture: ComponentFixture<FormComponent>;
| 

ERROR in ./src/app/message.service.spec.ts 6:13
Module parse failed: Unexpected token (6:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| 
| describe('MessageService', () => {
>   let service: MessageService;
| 
|   beforeEach(() => {

1 error has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

I installed the ts-loader package and removed node_modules and reinstall it. No luck, the package seems not to be loaded by thee webpack config

Reasons:
  • Blacklisted phrase (1): No luck
  • RegEx Blacklisted phrase (1): I have an error
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: AVA