-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: a couple of fixes for intercom integration; improved tests logging
- Loading branch information
1 parent
fccd2d2
commit 0da4836
Showing
9 changed files
with
167 additions
and
66 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 |
---|---|---|
@@ -1,38 +1,60 @@ | ||
import { testJitsuFunction, TestOptions } from "./lib/testing-lib"; | ||
import { IntercomDestinationCredentials } from "../src/meta"; | ||
import IntercomDestination from "../src/functions/intercom-destination"; | ||
import { setGlobalLogLevel, setServerLogColoring } from "juava"; | ||
|
||
setServerLogColoring(true); | ||
setGlobalLogLevel("debug"); | ||
|
||
test("test", async () => { | ||
if (!process.env.TEST_INTERCOM_DESTINATION_CONFIG) { | ||
console.log("TEST_INTERCOM_DESTINATION_CONFIG is not set, skipping test"); | ||
return; | ||
} | ||
const opts: TestOptions<IntercomDestinationCredentials> = { | ||
const email = "[email protected]"; | ||
const userId = "user-id-ds"; | ||
|
||
const workspaceId = "workspace-id-dm"; | ||
const workspaceName = "Dunder Mifflin"; | ||
const workspaceSlug = "dunder-mifflin"; | ||
const name = "Dwight Schrute"; | ||
|
||
let opts: TestOptions<IntercomDestinationCredentials>; | ||
opts = { | ||
func: IntercomDestination, | ||
configEnvVar: "TEST_INTERCOM_DESTINATION_CONFIG", | ||
events: [ | ||
{ | ||
type: "identify", | ||
userId: "cleviyagu0000zl13jld7acac", | ||
traits: { | ||
email: "[email protected]", | ||
name: "Vladimir Klimontovich", | ||
}, | ||
userId: userId, | ||
traits: { email, name }, | ||
timestamp: "2023-11-28T20:37:14.693Z", | ||
sentAt: "2023-11-28T20:37:14.693Z", | ||
messageId: "7qfgopt6mo22xk2tqs0tb", | ||
groupId: "cl9sotck40002tt2b18i2x430", | ||
groupId: workspaceId, | ||
context: {}, | ||
receivedAt: "2023-11-28T20:37:14.799Z", | ||
}, | ||
{ | ||
type: "group", | ||
groupId: "cl9sotck40002tt2b18i2x430", | ||
traits: { | ||
workspaceSlug: "jitsu", | ||
workspaceName: "Jitsu Playground", | ||
workspaceId: "cl9sotck40002tt2b18i2x430", | ||
type: "track", | ||
event: "user_created", | ||
properties: {}, | ||
userId: userId, | ||
timestamp: "2023-11-29T16:55:50.255Z", | ||
sentAt: "2023-11-29T16:55:50.255Z", | ||
messageId: "22ccyzg8enx2duj3bcit8h", | ||
writeKey: "FDiExsmGYePJa651vnN7LyhMQYq972s1:***", | ||
context: { | ||
traits: { email, name, externalId: `ext-${userId}` }, | ||
page: {}, | ||
clientIds: {}, | ||
campaign: {}, | ||
}, | ||
}, | ||
{ | ||
type: "group", | ||
groupId: workspaceId, | ||
traits: { workspaceSlug, workspaceName, workspaceId, name: workspaceName }, | ||
timestamp: "2023-11-28T20:37:14.673Z", | ||
sentAt: "2023-11-28T20:37:14.673Z", | ||
messageId: "1xdx6pryjnuqgi4jz362j", | ||
|
@@ -41,30 +63,63 @@ test("test", async () => { | |
}, | ||
{ | ||
type: "track", | ||
event: "workspace_access", | ||
properties: { | ||
workspaceSlug: "jitsu", | ||
workspaceName: "Jitsu Playground", | ||
workspaceId: "cl9sotck40002tt2b18i2x430", | ||
event: "workspace_created", | ||
properties: {}, | ||
userId, | ||
timestamp: "2023-11-29T19:02:36.535Z", | ||
sentAt: "2023-11-29T19:02:36.535Z", | ||
messageId: "223drh0xi901pujmvl2kds", | ||
writeKey: "FDiExsmGYePJa651vnN7LyhMQYq972s1:***", | ||
groupId: "clpk4wd6n0000l90fmzoahn63", | ||
context: { | ||
traits: { | ||
workspaceName, | ||
workspaceId, | ||
email, | ||
name, | ||
externalId: `ext-${userId}`, | ||
}, | ||
page: {}, | ||
clientIds: {}, | ||
campaign: {}, | ||
}, | ||
receivedAt: "2023-11-29T19:02:36.643Z", | ||
}, | ||
{ | ||
type: "page", | ||
userId, | ||
groupId: workspaceId, | ||
timestamp: "2023-11-29T19:02:36.152Z", | ||
messageId: "1m6c2acu28b1bt4eak2qk1", | ||
context: { | ||
traits: { | ||
email, | ||
name, | ||
externalId: `ext-${userId}`, | ||
}, | ||
page: { | ||
title: "Jitsu", | ||
url: "https://use.jitsu.com/", | ||
path: `/${workspaceSlug}`, | ||
}, | ||
}, | ||
userId: "cleviyagu0000zl13jld7acac", | ||
}, | ||
{ | ||
type: "track", | ||
event: "workspace_access", | ||
properties: { workspaceSlug, workspaceName, workspaceId }, | ||
userId, | ||
anonymousId: "7c3f1bac-2e04-4ebf-8d34-95d56fb126ac", | ||
timestamp: "2023-11-28T20:36:42.201Z", | ||
sentAt: "2023-11-28T20:36:42.201Z", | ||
messageId: "24zebq8rj3414ubowikeup", | ||
groupId: "cl9sotck40002tt2b18i2x430", | ||
groupId: workspaceId, | ||
context: { | ||
library: { | ||
name: "@jitsu/js", | ||
version: "0.0.0", | ||
}, | ||
traits: { | ||
workspaceSlug: "jitsu", | ||
workspaceName: "Jitsu Playground", | ||
workspaceId: "cl9sotck40002tt2b18i2x430", | ||
email: "[email protected]", | ||
name: "Vladimir Klimontovich", | ||
}, | ||
traits: { workspaceSlug, workspaceName, workspaceId, email, name }, | ||
page: {}, | ||
clientIds: {}, | ||
campaign: {}, | ||
|
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,8 @@ | ||
|
||
global.console = { | ||
log: message => process.stdout.write(message + '\n'), | ||
error: console.error, | ||
warn: console.warn, | ||
info: console.info, | ||
debug: console.debug, | ||
}; |
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.
0da4836
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
new-jitsu-ee-api – ./webapps/ee-api
new-jitsu-ee-api.staging.jitsu.com
new-jitsu-ee-api-git-newjitsu.staging.jitsu.com
ee.jitsu.dev
onetag-ee-api.vercel.app
0da4836
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
new-jitsu – ./webapps/console
ag.ru
logu.au
ozon.ru
sse.ere
erxes.io
baidu.dom
sambla.se
bobsec.com
sambla.com
agro4u.life
bluetick.ai
protontv.eu
t.quenti.io
alicesec.com
dev.aclis.io
docs.dh19.de
docs.dh19.eu
joseviso.com
mydomain.dom
t.democo.dev
t.shoppub.io
t2.jitsu.com
timeplus.com
zoopsign.com
*.d.jitsu.com
beta.mitzu.io
d.versatus.io
data.light.so
data.loudy.co
data.schej.it
imusician.app
imusician.pro
jitsu.logu.au
jitsu.www1.ru
t.thequack.ai
thinkr.com.br
use.jitsu.com
usepolygon.io
www.sambla.se
ajewellers.com
data.uselog.io
gpt.whatfa.com
sidetrekai.com
t.papermark.io
t.saasmonk.app
use2.jitsu.com
www.kellen.top
*.dataspecc.com
app.bluetick.ai
caddy.jitsu.com
data.askloan.tw
enterticket.com
events.mitzu.io
jitsu.efeer.com
jitsu.ivve.tech
krestomatio.com
sevenbillion.co
xrt.webxr.tools
www.sevenbillion.co
analytics.mtrsvc.com
data.embeddables.com
mercury.stagehub.com
store.sidetrekai.com
teslahenry.github.io
data.hogarlylabs.tech
event.clickncruise.hu
event.clickncruise.ro
test-domain.jitsu.com
teste.fazcomex.com.br
analytics.dev.knekt.io
loraboutiquedental.com
notion.twelftree.co.uk
dev-portal.zoopsign.com
event.tradejobsnz.co.nz
savvy-replay.jitsu.tech
data.analytics-smart.com
event.clickncruise.co.uk
jt.fairhopeweb.github.io
savvy-replay2.jitsu.tech
savvy-replay3.jitsu.tech
savvy-replay4.jitsu.tech
track.alquimiaweb.com.br
track.pressance-group.jp
track.uniquecafes.com.br
colectha.agenciavoolu.com
kolectha.agenciavoolu.com
lp.loraboutiquedental.com
stage-portal.zoopsign.com
new-jitsu.staging.jitsu.com
lodercom-colectha.voolu.shop
warehouse1.trendstyle.com.au
d0.livingdesignsfurniture.com
jitsu.precisaosistemas.com.br
analytics.inspiresolutions.app
canvas.livingdesignsfurniture.com
analytics.dev.inspiresolutions.app
clm2jikrm00002v6r5l6niws3.d.jitsu.com
new-jitsu-git-newjitsu.staging.jitsu.com
3000-rajaraodv-customerdemo-nmpsqwflswt.ws-us102.gitpod.io
new.jitsu.dev