Skip to content

Instantly share code, notes, and snippets.

View ryanjyost's full-sized avatar

Ryan Yost ryanjyost

View GitHub Profile
// Questions for Guy
// 1. What to do with bulk deletion branch
// 2. What to do with tags branch
// Any prefs for design of creator view? Especially stuff in the sidebar? Hannah mentioned a cog situation,
// and I know the redesign is happening
// How is a collection different from a form?
// Is a collection similar to a review form? Or are these just types of forms.
// Collections need to know collection folder, that data seems unique to collection concept vs. just a form
@ryanjyost
ryanjyost / index.js
Created March 19, 2020 01:19
support/index
Cypress.on("window:before:load", win => {
cy.stub(win.console, "error", msg => {
if (msg.includes("This is an error")) {
return null;
}
cy.now("task", "error", msg);
throw new Error(msg);
});
@ryanjyost
ryanjyost / index.js
Created March 19, 2020 01:18
support/index
Cypress.on("window:before:load", win => {
cy.stub(win.console, "error", msg => {
cy.now("task", "error", msg);
throw new Error(msg); // all we needed to add!
});
cy.stub(win.console, "warn", msg => {
cy.now("task", "warn", msg);
});
});
@ryanjyost
ryanjyost / index.js
Created March 19, 2020 01:17
plugins
module.exports = on => {
on(`task`, {
error(message) {
console.error("\x1b[31m", "ERROR:", message, "\x1b[0m");
},
warn(message) {
console.warn("\x1b[33m", "WARNING:", message, "\x1b[0m");
},
});
};
@ryanjyost
ryanjyost / index.js
Created March 19, 2020 01:17
commands/index
Cypress.on("window:before:load", win => {
cy.stub(win.console, "error", msg => {
cy.now("task", "error", msg);
});
cy.stub(win.console, "warn", msg => {
cy.now("task", "warn", msg);
});
});
@ryanjyost
ryanjyost / App.js
Created March 19, 2020 01:16
App with logs
//... same above
function App() {
const [loaded, setLoaded] = useState(false);
useEffect(() => {
console.log("This is a log");
console.warn("This is a warning");
console.error("This is an error");
@ryanjyost
ryanjyost / seventh.js
Created March 19, 2020 01:15
Seventh
it("has a link pointing to the react website", function() {
cy.server();
cy.route("/200?**").as("fakeNetworkRequest");
cy.visit("http://localhost:3000");
cy.wait("@fakeNetworkRequest");
cy.verifyLink("Learn React", "https://reactjs.org");
});
describe("Cypress Tutorial", function() {
beforeEach(function() {
cy.server();
cy.route("/200?**").as("fakeNetworkRequest");
cy.visit("http://localhost:3000");
cy.wait("@fakeNetworkRequest");
});
@ryanjyost
ryanjyost / fifth.js
Last active March 19, 2020 01:14
fifth
it("has a link pointing to the react website", function() {
cy.server();
cy.route("/200?**").as("fakeNetworkRequest");
cy.visit("http://localhost:3000");
cy.wait("@fakeNetworkRequest");
cy.verifyLink("Learn React", "https://reactjs.org");
});
it("has a link pointing to the react website", function() {
cy.server();
cy.route("/200?**").as("fakeNetworkRequest");
cy.visit("http://localhost:3000");
cy.wait("@fakeNetworkRequest");
cy.findByText("Learn React").should(
"have.attr",