Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add test runner middleware #293

Merged
merged 2 commits into from
Mar 16, 2020
Merged

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Mar 11, 2020

Static resources are copied over from OpenUI5.

Should we add this to our LICENSE.txt? 🤔

Static resources are copied over from OpenUI5.
function createMiddleware({resources}) {
return async function(req, res, next) {
try {
const pathname = req.path; // TODO: Other middlewares use the parseurl module here but I don't get why
Copy link
Member

Choose a reason for hiding this comment

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

I think req.path might contain a query. That's why parseurl is used.

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this stem from the time when our middlewares have been used in different server environments? See e.g. #183 .

Copy link
Member Author

Choose a reason for hiding this comment

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

@codeworrior thank you for digging that out!

The express documentation makes it pretty clear that req.path does not contain the query: https://expressjs.com/en/api.html#req.path

Since we already use parseurl elsewhere, I guess it doesn't hurt to offer the same compatibility as the other middlewares. I'll change the code 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

To be compatible with connect middleware APIs
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 93.47% when pulling 47a93b0 on testrunner-middleware into f8958c1 on master.

@svbender
Copy link
Contributor

Looks good, but the test coverage decreased a little bit.

@RandomByte
Copy link
Member Author

@svbender Yes, but in serveIndex.js which I didn't even touch. I don't really get why

@RandomByte
Copy link
Member Author

As agreed with @codeworrior, including OpenUI5 code should not require a mention in the subcomponents part of LICENSE.txt. OpenUI5 is provided by the same entity (SAP SE) and under the same license (Apache 2.0)

@RandomByte RandomByte merged commit ea4c3fb into master Mar 16, 2020
@RandomByte RandomByte deleted the testrunner-middleware branch March 16, 2020 11:47
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.

None yet

5 participants