-
Notifications
You must be signed in to change notification settings - Fork 793
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
[instrumentation] replace cpx2
with a local module in tests/fixtures/
exclusively for testing
#4533
Comments
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
@pichlermarc To began working on this I want to make sure to move in right direction. Question: Do we prefer a particular JS testing framework for opentelemetry-js? |
Yes, it looks like I made a mistake when I was writing this - it should not go into That can be a simple Then you can change the test setup and test to use the new fake
We do use mocha and usually don't accept any changes that start using another framework - so that should stay the same. The goal of this issue is to change the existing tests, there's no need to introduce any new ones 🙂 |
@pichlermarc Please reviewing my local changes, the code is compling without errors or warnings but, |
The test-module that was introduced on that branch does not match the way the layout is in In
and in In
To mimic the same behavior you can simply move the Then you can also add a {
"name": "test-non-core-module",
"version": "0.0.1",
"description": "Local test module for require-in-the-middle singleton",
"main": "lib/index.js"
} (the important thing here is |
In
@opentelemetry/instrumentation
we testRequireInTheMiddleSingleton
by using thecpx2
package.opentelemetry-js/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts
Lines 42 to 43 in 63d74cd
As we don't use the
cpx2
package anywhere else anymore, having a local test package would help us get rid of that dependencyTo complete this issue we need to:
cpx2
is structured for testing in./tests/fixtures/
package.json
Originally posted by @trentm in #4510 (review)
The text was updated successfully, but these errors were encountered: