Skip to content

Commit

Permalink
Confirm that trailing slashes are dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBennett authored Jun 17, 2022
1 parent 1a0d596 commit 143c01c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ describe("processEvent", () => {

const processedEvent = await processEvent(sourceEvent, getMeta());

console.log("processedEvent = ", processedEvent);

expect(processedEvent?.properties?.current_url).toEqual(
"http://www.google.com"
);
Expand All @@ -46,14 +44,23 @@ describe("processEvent", () => {

const processedEvent = await processEvent(sourceEvent, getMeta());

console.log("processedEvent = ", processedEvent);

expect(processedEvent?.properties?.current_url).toEqual(
"http://www.google.com/whatareyouthinking"
);
});

it.todo("should remove the trailing slash from the current_url");
it("should remove the trailing slash from the current_url", async () => {
const sourceEvent = buildPageViewEvent(
"http://www.google.com/this_is_a_test/"
);

const processedEvent = await processEvent(sourceEvent, getMeta());

expect(processedEvent?.properties?.current_url).toEqual(
"http://www.google.com/this_is_a_test"
);
});

it.todo("should preserve trailing id anchors");
it.todo("shouldn't modify events that don't have a current_url set");
});

0 comments on commit 143c01c

Please sign in to comment.