Skip to content

Fixes #2198 - Pass in targetOrigin from intern config for tests#3280

Merged
miketaylr merged 2 commits intomasterfrom
issues/2198/1
Apr 9, 2020
Merged

Fixes #2198 - Pass in targetOrigin from intern config for tests#3280
miketaylr merged 2 commits intomasterfrom
issues/2198/1

Conversation

@miketaylr
Copy link
Copy Markdown
Member

(Rather than hard-code)

r? @magsout

@miketaylr miketaylr requested a review from magsout April 8, 2020 21:09
const { registerSuite } = intern.getInterface("object");
const FunctionalHelpers = require("./lib/helpers.js");
const url = intern.config.functionalBaseUrl + "issues/new";
const targetOrigin = intern.config.functionalBaseUrl.slice(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is super verbose!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like verbose const ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh

const url = intern.config.functionalBaseUrl + "issues/new";
const baseUrl = intern.config.functionalBaseUrl;
const url = baseUrl + "issues/new";
const targetOrigin = baseUrl.slice(0, baseUrl.length - 1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum, why? to remove the last 0 or maybe an / ?

"http://localhost:5000".slice(0, "http://localhost:5000".length -1)

-> "http://localhost:500"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, so this is kind of weird, but when you access the value intern adds a terminating / -> http://localhost:5000/, and postMessage won't match on that.

(maybe i should file a bug with intern...)

@miketaylr miketaylr merged commit 15970fb into master Apr 9, 2020
@miketaylr miketaylr deleted the issues/2198/1 branch April 9, 2020 20:48
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