Skip to content

Conversation

@nedtwigg
Copy link
Member

@nedtwigg nedtwigg commented Sep 6, 2025

Intro guide!

  • npm install
  • npm run har:view
    • opens a server that looks like this
image

The clean is a "clean catch" of the URL in question. The gitcasso has our content-script applied. You can only do the gitcasso if you have a dev server running. The hotreload doesn't seem to work as far as I can tell. (since #20 it now has a button in top-right that triggers a full dev build and refreshes the page)

You can also run a unit test against the captured HTML, note in particular usingHar('gh_pr')

describe('github', () => {
usingHar('gh_pr').it('should create the correct spot object', async () => {
const enhancers = new EnhancerRegistry()
const textareas = document.querySelectorAll('textarea')
expect(textareas.length).toBe(2)
expect(enhancers.tryToEnhance(textareas[0]!)).toBeNull()
expect(enhancers.tryToEnhance(textareas[1]!)?.spot).toMatchInlineSnapshot(`
{
"domain": "github.com",
"number": 517,
"slug": "diffplug/selfie",
"type": "GH_PR_ADD_COMMENT",
"unique_key": "github.com:diffplug/selfie:517",
}
`)
})

  • for detection, I would think that the unit tests might be an easier way to test
  • npm run har:view hopefully makes the edit/refresh cycle less painful for graphical fidelity

@nedtwigg nedtwigg marked this pull request as ready for review September 6, 2025 08:22
@nedtwigg nedtwigg merged commit 1e2ad6a into main Sep 6, 2025
1 check passed
@nedtwigg nedtwigg deleted the feat/add-hars branch September 6, 2025 08:23
@nedtwigg nedtwigg mentioned this pull request Sep 6, 2025
3 tasks
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

Successfully merging this pull request may close these issues.

2 participants