-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
18,663 additions
and
1,716 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
|
||
jobs: | ||
ssr: | ||
name: Cypress | ||
name: Build and check ES5/ES6 support | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -21,3 +21,6 @@ jobs: | |
|
||
- name: Run es-check to check if our ie11 bundle is ES5 compatible | ||
run: npx [email protected] es5 dist/array.full.es5.js | ||
|
||
- name: Run es-check to check if our main bundle is ES6 compatible | ||
run: npx [email protected] es6 dist/array.full.js |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import { start } from '../support/setup' | ||
import { isArray } from '../../src/utils/type-utils' | ||
|
||
describe('before_send', () => { | ||
it('can sample and edit with before_send', () => { | ||
start({}) | ||
|
||
cy.posthog().then((posthog) => { | ||
let counter = 0 | ||
const og = posthog.config.before_send | ||
// cypress tests rely on existing before_send function to capture events | ||
// so we have to add it back in here | ||
posthog.config.before_send = [ | ||
(cr) => { | ||
if (cr.event === 'custom-event') { | ||
counter++ | ||
if (counter === 2) { | ||
return null | ||
} | ||
} | ||
if (cr.event === '$autocapture') { | ||
return { | ||
...cr, | ||
event: 'redacted', | ||
} | ||
} | ||
return cr | ||
}, | ||
...(isArray(og) ? og : [og]), | ||
] | ||
}) | ||
|
||
cy.get('[data-cy-custom-event-button]').click() | ||
cy.get('[data-cy-custom-event-button]').click() | ||
|
||
cy.phCaptures().should('deep.equal', [ | ||
// before adding the new before sendfn | ||
'$pageview', | ||
'redacted', | ||
'custom-event', | ||
// second button click only has the redacted autocapture event | ||
'redacted', | ||
// because the second custom-event is rejected | ||
]) | ||
}) | ||
}) |
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
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
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
Oops, something went wrong.