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

test: Migrated test/unit/util to use node:test #2546

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

bizob2828
Copy link
Member

Related Issues

Closes #2539

@bizob2828 bizob2828 added the dev:tests Indicates only changes to tests label Sep 4, 2024
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.19%. Comparing base (c207e1e) to head (d5c230f).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2546   +/-   ##
=======================================
  Coverage   97.19%   97.19%           
=======================================
  Files         289      289           
  Lines       45416    45448   +32     
=======================================
+ Hits        44140    44172   +32     
  Misses       1276     1276           
Flag Coverage Δ
integration-tests-cjs-18.x 73.81% <ø> (+<0.01%) ⬆️
integration-tests-cjs-20.x 73.83% <ø> (+0.02%) ⬆️
integration-tests-cjs-22.x 73.87% <ø> (+0.02%) ⬆️
integration-tests-esm-18.x 49.18% <ø> (+0.03%) ⬆️
integration-tests-esm-20.x 49.19% <ø> (+0.03%) ⬆️
integration-tests-esm-22.x 49.21% <ø> (+0.03%) ⬆️
unit-tests-18.x 88.76% <ø> (+0.05%) ⬆️
unit-tests-20.x 88.76% <ø> (+0.05%) ⬆️
unit-tests-22.x 88.77% <ø> (+0.05%) ⬆️
versioned-tests-18.x 78.85% <ø> (-0.13%) ⬇️
versioned-tests-20.x 78.88% <ø> (-0.11%) ⬇️
versioned-tests-22.x 78.89% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jsumners-nr
jsumners-nr previously approved these changes Sep 6, 2024
test/unit/util/application-logging.test.js Outdated Show resolved Hide resolved
Comment on lines +92 to +93
await Promise.all(
features.map(async ({ feature, method }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This one, however, does have the hooks present. Are we sure they are getting applied correctly?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is working.

node test/unit/util/application-logging.test.js | grep 'before test' | wc -l

outputs

8

6 for the fixtures and 2 for the standalone

t.ok(test.obfuscated.includes(obfuscated))
}
function runTest(t, testCase, dialect) {
t.diagnostic(dialect)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, this isn't going to print inline with the actual test in the output. Diagnostic messages get collected and reported after all tests are done 😢

Copy link
Member Author

Choose a reason for hiding this comment

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

they seem to post inline

  ℹ postgres
  ℹ cassandra
  ✔ uuid_with_braces (0.01925ms)
  ℹ postgres
  ✔ uuid_no_dashes (0.01825ms)
  ℹ postgres
  ✔ uuid_random_dashes (0.017791ms)
  ℹ postgres
  ✔ booleans (0.019708ms)
  ℹ mysql
  ℹ postgres
  ℹ cassandra
  ℹ sqlite
  ✔ in_clause_digits (0.021291ms)
  ℹ mysql
  ℹ postgres
  ℹ oracle
  ℹ cassandra
  ℹ mssql
  ✔ in_clause_strings (0.028792ms)
  ℹ mysql
  ℹ postgres
  ℹ oracle
  ℹ cassandra
  ℹ mssql
  ✔ should handle line endings (0.045709ms)

@bizob2828 bizob2828 merged commit 0b07be8 into newrelic:main Sep 9, 2024
29 checks passed
@bizob2828 bizob2828 deleted the convert-util branch September 9, 2024 14:42
@github-actions github-actions bot mentioned this pull request Sep 11, 2024
sumitsuthar pushed a commit to k2io/fork-node-newrelic that referenced this pull request Sep 20, 2024
sumitsuthar added a commit to k2io/fork-node-newrelic that referenced this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:tests Indicates only changes to tests
Projects
Status: Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

Convert test/unit/util tests to node:test
2 participants