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

MWPW-134706 Reevaluate bacom-blog repo #11

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

Brandon32
Copy link
Contributor

  • Updating from Milo College and changing mountpoint to reevaluate the bacom-blog repo for blog migration.

Resolves: MWPW-134706

Test URLs:

@aem-code-sync
Copy link

aem-code-sync bot commented Aug 8, 2023

Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-run PSI Checks

@aem-code-sync
Copy link

aem-code-sync bot commented Aug 8, 2023

Page Scores Audits Google
/?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@aem-code-sync

This comment was marked as outdated.

@codecov-commenter
Copy link

Codecov Report

Merging #11 (794d169) into main (9d85bd2) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #11   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         2    +1     
  Lines           31        67   +36     
=========================================
+ Hits            31        67   +36     
Files Changed Coverage Δ
scripts/utils.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aem-code-sync

This comment was marked as outdated.

@aem-code-sync
Copy link

aem-code-sync bot commented Aug 8, 2023

Page Scores Audits Google
/?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link
Contributor

@meganthecoder meganthecoder left a comment

Choose a reason for hiding this comment

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

Am I correct in assuming that other than changing the mount point, these changes are all to match milo?

Comment on lines +1 to +79
/* eslint-disable import/no-extraneous-dependencies */
import { importMapsPlugin } from '@web/dev-server-import-maps';
import { defaultReporter } from '@web/test-runner';

function customReporter() {
return {
async reportTestFileResults({ logger, sessionsForTestFile }) {
sessionsForTestFile.forEach((session) => {
session.testResults.tests.forEach((test) => {
if (!test.passed && !test.skipped) {
logger.log(test);
}
});
});
},
};
}
export default {
coverageConfig: {
exclude: [
'**/mocks/**',
'**/node_modules/**',
'**/test/**',
'**/deps/**',
],
},
plugins: [importMapsPlugin({})],
reporters: [
defaultReporter({ reportTestResults: true, reportTestProgress: true }),
customReporter(),
],
testRunnerHtml: (testFramework) => `
<html>
<head>
<script type='module'>
const oldFetch = window.fetch;
window.fetch = async (resource, options) => {
if (!resource.startsWith('/') && !resource.startsWith('http://localhost')) {
console.error(
'** fetch request for an external resource is disallowed in unit tests, please find a way to mock! https://github.com/orgs/adobecom/discussions/814#discussioncomment-6060759 provides guidance on how to fix the issue.',
resource
);
}
return oldFetch.call(window, resource, options);
};

const oldXHROpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = async function (...args) {
let [method, url, asyn] = args;
if (!resource.startsWith('/') && url.startsWith('http://localhost')) {
console.error(
'** XMLHttpRequest request for an external resource is disallowed in unit tests, please find a way to mock! https://github.com/orgs/adobecom/discussions/814#discussioncomment-6060759 provides guidance on how to fix the issue.',
url
);
}
return oldXHROpen.apply(this, args);
};
const observer = new MutationObserver((mutationsList, observer) => {
for(let mutation of mutationsList) {
if (mutation.type === 'childList') {
for(let node of mutation.addedNodes) {
if(node.nodeName === 'SCRIPT' && node.src && !node.src.startsWith('http://localhost')) {
console.error(
'** An external 3rd script has been added. This is disallowed in unit tests, please find a way to mock! https://github.com/orgs/adobecom/discussions/814#discussioncomment-6060891 provides guidance on how to fix the issue.',
node.src
);
}
}
}
}
});
observer.observe(document.head, { childList: true });
</script>
</head>
<body>
<script type='module' src='${testFramework}'></script>
</body>
</html>`,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

this file has the mjs extension in milo, why change it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To match milo-college, it is using "type": "module" in package.json so mjs is redundant.

@Brandon32
Copy link
Contributor Author

Am I correct in assuming that other than changing the mount point, these changes are all to match milo?

@meganthecoder To match milo consumers, I using milo-college to see what changed: adobecom/milo-college@53743b7...main

@Brandon32 Brandon32 merged commit 43fb3a0 into main Aug 10, 2023
3 checks passed
@Brandon32 Brandon32 deleted the bmarshal/reeveluate-blog branch August 10, 2023 16:13
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.

4 participants