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

Multiple cassettes found when tests have same base name #2

Closed
pdjohntony opened this issue Mar 22, 2024 · 1 comment
Closed

Multiple cassettes found when tests have same base name #2

pdjohntony opened this issue Mar 22, 2024 · 1 comment

Comments

@pdjohntony
Copy link
Owner

This issue is a result of fixing #1 in v1.1.2.

Now that cassette searching can match multiple files for a single test, if two tests share the same base name, the wrong cassette can be matched for a test.

Here is the new cassette matching code:

const matchingFiles = files.filter(file => file.startsWith(`${vcrDecorator.vcrTestName}`) && file.endsWith('.yaml'));

Here are some example test names:

test_msteams_service_emergency_address_create
test_msteams_service_emergency_address_create_without_latlon

These overlapping names will cause test_msteams_service_emergency_address_create to also match the cassettes for test_msteams_service_emergency_address_create_without_latlon.

This is also causing an issue during the deleteCassettesCurrentFile command. Where the same cassettes can become duplicated in the currentFileCassettesArray and will cause subsequent deletion failures.

@pdjohntony
Copy link
Owner Author

Fixed in 1.1.3

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

No branches or pull requests

1 participant