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

Compute path for axios #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

pawfa
Copy link
Collaborator

@pawfa pawfa commented Oct 8, 2023

Closes #67

Additionaly this PR introduces baseURL which can be set in pacts.config.js. This option allows to set prefix path for all interactions.
It is heplful when you use baseURL from axios.

@pawfa pawfa requested a review from a team as a code owner October 8, 2023 08:06
private generatePathFromNode(node: tsMorph.Node): string {
// simple string
if (node.getType().isStringLiteral()) {
return node.getType().getText().replace(/["']/g, '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Please fill in the docs with information about automatic retrieval of path when using @pact-axios.

Also probably not related to this change, but since we're not supporting axios.request(config) or axios(url, config) functions, it may be worth to include in the docs what axios methods we support

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.

Resolve path from axios request
2 participants