Created
December 23, 2019 15:12
-
-
Save bobmacneal/e60ac2ef7b804bed7a99f9de639c7bc5 to your computer and use it in GitHub Desktop.
Cypress Command to Stub /sockjs-node/info?t=*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cypress.Commands.add('mockSockJs', () => { | |
const url = '/sockjs-node/info?t=*' | |
cy.server() | |
cy.route({ | |
method: 'GET', | |
url: url, | |
response: 'fixture:sockJs.json', | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the interest of stubbing all network traffic in my Cypress tests, I've created this Stub for
/sockjs-node/info?t=*
using an asterisk for the query parameter t.The
cypress/fixture
file, sockJs.json, contains the following data: