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

I keep getting results as undefined #28

Open
lefado opened this issue Mar 15, 2022 · 0 comments
Open

I keep getting results as undefined #28

lefado opened this issue Mar 15, 2022 · 0 comments

Comments

@lefado
Copy link

lefado commented Mar 15, 2022

Hi there!

I am trying to use your library into my project. However, I am not able to read websocket messages. As a PoC, I have used https://websocketstest.com/ site, in order to try to check ws messages. However, I have no luck so far yet.

Code

type MessageType = "CONNECTED" | "LOGIN" | "RECORD" | "END" | "connected" | "version" | "echo" | "time";

interface IMessage {
  type: MessageType;
  data: any;
}

it.only('test 2', function () {
  cy.visit('https://websocketstest.com/')
  const config: WebSocketSubjectConfig<IMessage> = {
    url: "wss://websocketstest.com/service"
  };
  const options = {};
  // Wrap the request in order to bypass the defaultCommandTimeout
  // Investigating alternative solutions      
  cy.wrap(null, { timeout: 10000 }).then(() =>
  cy.streamRequest<IMessage>(config, options).then(results => {
    // debugger      
    expect(results).to.not.be.undefined;
  })
  );
})

Am I missing something?

Thanks in advance

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

1 participant