Skip to content

Instantly share code, notes, and snippets.

View davidmaxwaterman's full-sized avatar

Max Waterman davidmaxwaterman

View GitHub Profile
@davidmaxwaterman
davidmaxwaterman / gun-panic-notes.md
Last active January 25, 2023 21:27
Notes on writing end-to-end tests with gun's panic server/client.

The docs on Gun's Panic are written from the point of view of someone testing Gun itself, rather than an app that uses Gun. As such it isn't very helpful in how to get started, and the tests aren't all that applicable. So, I figured I'd share my findings after building Panic tests for my app.

refs:

NB, in my case, I was using Gun in an extension, so my 'app' is quite well separated from the panic server. Most people will be testing Gun in a regular web page, so it might be simpler.

  1. in the project you want to test, install dev dependency gun-server: npm install --save-dev panic-server
```javascript
async function fetchIconUrls(url) {
console.info(`fetching icon for ${url} manually`);
const response = await fetch(url);
const text = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(text, "text/html");
const iconLinks = doc.querySelectorAll("link[rel~=icon]");
const retVal = [...iconLinks].map(iconLink => {
@davidmaxwaterman
davidmaxwaterman / gist:7152a5859b1c4a9f18e4
Created May 11, 2015 08:18
bower conflicts for polymer/paper/core 0.5.6
Please note that,
    core-a11y-keys#0.5.6, core-animation#0.5.6, core-collapse#0.5.6, core-component-page#0.5.6, core-dropdown#0.5.6, core-focusable#0.5.6, core-header-panel#0.5.6, core-icons#0.5.6, core-iconset#0.5.6, core-iconset-svg#0.5.6, core-input#0.5.6, core-label#0.5.6, core-media-query#0.5.6, core-meta#0.5.6, core-overlay#0.5.6, core-selection#0.5.6, core-selector#0.5.6, core-style#0.5.6, core-transition#0.5.6, paper-button#0.5.6, paper-dialog#0.5.6, paper-dropdown#0.5.6, paper-dropdown-menu#0.5.6, paper-icon-button#0.5.6, paper-input#0.5.6, paper-item#0.5.6, paper-shadow#0.5.6 depends on polymer#^0.5 which resolved to polymer#0.5.2
    the-graph#9c5e6d6715 depends on polymer#0.5.2 which resolved to polymer#0.5.2
    DAVE depends on polymer#~0.5.5 which resolved to polymer#0.5.6
Resort to using polymer#~0.5.5 which resolved to polymer#0.5.6
Code incompatibilities may occur.


Unable to find a suitable version for webcomponentsjs, please choose one: