We have a large test suite running on a CI server, and there appears to be no way of telling Cypress to exit if a test fails. It always runs the entire suite. There is some discussion here, but no workable solution. Is there a reliable way to have Cypress exit as soon as a test fails? Answer As you’ve
Tag: javascript
Is there a way to get all documents in a subcollection (Firestore)
I’m having difficulties querying all documents inside a subcollection in my Firestore database. (I am using Node.js) My goal is to get all the data from every document inside the subcollection named favorites My database structure looks like this. I looked at the documentation at https://firebase.google.com/docs/firestore/query-data/get-data but without any result how to solve the problem. My query looks like this
how to embed an image in a JSON response
I’m using Jimp to read in a JSON string that looks like this: As you can see the image node is a base64-encoded JPEG. I’m able to succesfully convert it to a TIFF and save it: However, when I attempted to embed the tiff inside of a JSON object, the TIFF gets all garbled up: Here’s the full code: How
How to use SignalR to send data to a specific user?
I have a client which receives messages over SignalR. It is working great but it is more like a broadcast. I would like to be able to send messages to a specific client. On the client-side I have a userId and I set up my connection like this: On the server-side (Azure Function written in JavaScript) I have a message
traverse through nested children of an array of objects and make a property equals false – JavaScript
I have a tree, that I want to traverse through. I want to make each internalChecked = false. I wrote some code, but failed. Tree Answer You are pushing every json chunk in an output array that makes the output different than it is, just use __json[i].internalChecked = false in your loop and it will update the array on which
How to test if a component is rendered with the right props when using react-testing-library?
I have some components that are rendering another component (FetchNextPageButton) that is already tested in isolation, like these ones: The thing is that I’d not like having to add tests on each of these components for a functionality that is already tested somewhere else, so I think that should be enough just to test that the component is rendered and
extend existing API with custom endpoints
I’m creating an API for multiple customers. The core endpoints like /users are used by every customer but some endpoints rely on individual customization. So it might be that User A wants a special endpoint /groups and no other customer will have that feature. Just as a sidenote, each customer would also use his own database schema because of those
How to use windowWidth and windowHeight outside of setup()?
I need the screen dimensions for a project, but trying windowWidth and windowHeight yields an error saying I can’t use them outside of setup(). I also tried defining the windowWidth and Height to a new constant, but it simply says the constant has not been defined. Here’s the current state of my code (doesn’t work, but gives a pretty good
How to write multi-line scripts in Pug and Facebook JS SDK
I’m trying to include a multi-line JavaScript function inside the script tag within my layout pug template. It needs to run in the script tag, i.e. it has to be done this way and cannot be passed into the template as a value, since it’s client-side logic within a node app. This is the equivalent in vanilla HTML: Since I’m
Ensure `click` event is seen by the content script
I’m writing an extension for Chrome that listen and capture the click events made by the user. This is the way I’m capturing the event It works good in many cases, but there’re other cases where click event never get triggered, instead there’re one or more focusout events that get triggered. I understad that focusout event may be shooted when