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

Converted Certificate Sample to TypeScript #7368

Merged
merged 53 commits into from
Nov 18, 2024
Merged

Conversation

Robbie-Microsoft
Copy link
Collaborator

This is the first time we'll have an E2E test running on a TypeScript sample. They all currently run on JS samples.

Base automatically changed from keyvault_cert_sample_2 to dev November 4, 2024 20:50
@Robbie-Microsoft Robbie-Microsoft requested a review from a team as a code owner November 4, 2024 20:50
@github-actions github-actions bot removed the msal-node Related to msal-node package label Nov 4, 2024
@github-actions github-actions bot added the documentation Related to documentation. label Nov 6, 2024
@@ -6,4 +6,5 @@
module.exports = {
displayName: "Client Credentials with Certificate from Key Vault",
preset: "../../e2eTestUtils/jest-puppeteer-utils/jest-preset-no-setup.js",
extensionsToTreatAsEsm: [".ts", ".tsx"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Collaborator Author

@Robbie-Microsoft Robbie-Microsoft Nov 7, 2024

Choose a reason for hiding this comment

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

I was getting some build errors without this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this an old run? It's referencing jest.config.js being treated as ESM but the file is, correctly, named jest.config.cjs now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is an old run. I receive that error when the file ends with ".js" instead of ".cjs". I can Google the difference I suppose, but for the purpose of discussion here, what is the ;TLDR difference between the two?

I can try keeping the file as ".cjs" and removing that line you asked the question about, and see if I still receive the build error.

Copy link
Collaborator

@tnorling tnorling Nov 8, 2024

Choose a reason for hiding this comment

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

Different module formats. If you've specified type: "module" in the package.json, .js file extensions are treated as ESM. Without the type specified .js extensions are treated as CJS. To explicitly use CJS or ESM use .cjs or .mjs respectively. In this case the config is written using CJS syntax so it either needs to use .cjs or remove type: "module" from the package.json

@AzureAD AzureAD deleted a comment from gladjohn Nov 6, 2024
@Robbie-Microsoft Robbie-Microsoft merged commit 1a82bfb into dev Nov 18, 2024
6 of 7 checks passed
@Robbie-Microsoft Robbie-Microsoft deleted the cert_sample_typescript branch November 18, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. samples Related to the samples apps for the library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants