-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Jest tests and publish automation with changesets #9
Conversation
@@ -31,7 +31,7 @@ injectorImportMaps.forEach((scriptEl) => { | |||
return r.json(); | |||
} else { | |||
throw Error( | |||
`${errPrefix} import map at url '${scriptEl.src}' must respond with a success HTTP status, but responded with HTTP ${r.status} ${r.statusText}`, | |||
`${errPrefix} Import map at url '${scriptEl.src}' must respond with a success HTTP status, but responded with HTTP ${r.status} ${r.statusText}`, |
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.
To harmonize the casing to the other error messages
@@ -69,8 +69,12 @@ const requiresMicroTick = importMapJsons.some( | |||
(json) => json instanceof Promise, | |||
); | |||
|
|||
const globalWindow = window as typeof window & { |
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.
Needed by Typescript (otherwise throws a type error)
@@ -112,3 +116,5 @@ function injectImportMap(importMaps: ImportMap[]): void { | |||
finalImportMapScriptEl.textContent = JSON.stringify(finalImportMap); | |||
document.head.appendChild(finalImportMapScriptEl); | |||
} | |||
|
|||
export {}; |
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.
Needed in order to be able to import the module in Jest. Otherwise, it complains the file is not a module.
Closed in favour of #10 |
This PR addresses issues:
In particular:
For this to work it is necessary that:
See single-spa/single-spa-react#178 for a description of how this works.
The automated pipeline includes:
Current coverage: