Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yuchuan1 opened this issue Mar 21, 2023 · 4 comments
Open

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

yuchuan1 opened this issue Mar 21, 2023 · 4 comments

Comments

@yuchuan1
Copy link

yuchuan1 commented Mar 21, 2023

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
Copy link

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
Copy link

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
Copy link
Member

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.

@StargateSGx1
Copy link

StargateSGx1 commented Sep 7, 2024

I have the same Problem. Has someone a solution for this jest Error? @yuchuan1 and @nspourriel did you find a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants