stomp-js / rx-stomp

STOMP adaptor for RxJS
Apache License 2.0
110 stars 21 forks source link

unit test with jest broke after upgrading from 1.14 to 2.0.0 #524

Open yuchuan1 opened 1 year ago

yuchuan1 commented 1 year ago

src

export class WebsocketService {
...
constructor(
    private store: Store,
    private translateService: TranslateService,
    public socket: RxStompService
  ) {
    this.socket = new RxStompService();

    this.socket.connectionState$
      .pipe(untilDestroyed(this))
      .subscribe((d: RxStompState) => {
        this.store.dispatch(wsUpdateState({ state: RxStompState[d] }));
      });

Error Message

Details:

    /Users/eddie/iabg/holmes/node_modules/@stomp/rx-stomp/esm6/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './rx-stomp-config.js';
                                                                                      ^^^^^^

    SyntaxError: Unexpected token 'export'

      3 | import { Store } from '@ngrx/store';
      4 | import { TranslateService } from '@ngx-translate/core';
    > 5 | import { RxStompState } from '@stomp/rx-stomp';
        | ^
      6 | import { Subscription } from 'rxjs';
carlabruti commented 12 months ago

Hi, i had the probleme in my project. I did this on my jest.config.js file :

transformIgnorePatterns: ['node_modules/(?!@angular|@stomp/rx-stomp)'],

don't if it will work for you.

nspourriel commented 3 months ago

Hi, this issue still exists and the recommended solution did not work for us. Is there any update comming on that topic?

thanks

kum-deepak commented 3 months ago

I do not use Jest. If anyone is able to create a simple project that shows the problem using GitHub, I can fork and try to fix the issue.