Skip to content

Conversation

eryue0220
Copy link
Contributor

This pr is to solve #5711 to add new todo api for test suite methods.

@eryue0220 eryue0220 requested a review from kt3k as a code owner June 5, 2025 03:31
@eryue0220 eryue0220 marked this pull request as draft June 5, 2025 03:39
@kt3k
Copy link
Member

kt3k commented Jun 5, 2025

We have policy to add new features as unstable APIs first. https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#suggesting-a-new-feature

Can you create a new file unstable_bdd.ts, re-export API from bdd.ts in there, and add these new APIs in unstable_bdd.ts?

@eryue0220
Copy link
Contributor Author

We have policy to add new features as unstable APIs first. https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#suggesting-a-new-feature

Can you create a new file unstable_bdd.ts, re-export API from bdd.ts in there, and add these new APIs in unstable_bdd.ts?

Sure, I'll update.

@eryue0220
Copy link
Contributor Author

@kt3k It seems there has a little problem, the describe.todo and test.todo are static method, if move them into another file, then the calling format will become like the following code:

import { describe } from "@std/testing/bdd"
import "@std/testing/unstable-bdd"

// then we can call `describe.todo`
describe.todo(/* function params */);

@kt3k
Copy link
Member

kt3k commented Jun 12, 2025

How about re-exporting all bdd APIs from unstable-bdd with additional APIs added?

import { describe } from "@std/testing/unstable-bdd"

// then we can call `describe.todo`
describe.todo(/* function params */);

@eryue0220
Copy link
Contributor Author

How about re-exporting all bdd APIs from unstable-bdd with additional APIs added?

import { describe } from "@std/testing/unstable-bdd"

// then we can call `describe.todo`
describe.todo(/* function params */);

Ohh, that's right

@eryue0220
Copy link
Contributor Author

How about re-exporting all bdd APIs from unstable-bdd with additional APIs added?

import { describe } from "@std/testing/unstable-bdd"

// then we can call `describe.todo`
describe.todo(/* function params */);

It seems not working, according to the ci, this will throw an error:

TS2440 [ERROR]: Import declaration conflicts with local declaration of 'describe'.

@eryue0220
Copy link
Contributor Author

Or rename the describe to unstable_describe?

@kt3k kt3k changed the title feat(testing): add it.todo test.todo and describe.todo API feat(testing/unstable): add it.todo test.todo and describe.todo API Jun 16, 2025
@kt3k
Copy link
Member

kt3k commented Jun 16, 2025

@eryue0220 I resolved the type errors in unstable_bdd.ts. Can you continue on other part? (I couldn't figure out the fixes for assertMinimumDescribeOptions and assertMinimumItOptions)

@eryue0220
Copy link
Contributor Author

@eryue0220 I resolved the type errors in unstable_bdd.ts. Can you continue on other part? (I couldn't figure out the fixes for assertMinimumDescribeOptions and assertMinimumItOptions)

Sure, because the params has a bit difference, one (assertMinimumItOptions) is access an array of fns, and the other is not.

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

❌ Patch coverage is 82.30769% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.11%. Comparing base (709c93b) to head (a07cd09).
⚠️ Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
testing/_test_helpers.ts 80.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6712      +/-   ##
==========================================
- Coverage   94.15%   94.11%   -0.04%     
==========================================
  Files         587      588       +1     
  Lines       42467    42597     +130     
  Branches     6702     6702              
==========================================
+ Hits        39984    40091     +107     
- Misses       2434     2457      +23     
  Partials       49       49              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eryue0220 eryue0220 marked this pull request as ready for review July 17, 2025 16:14
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in review!

LGTM!

@kt3k kt3k merged commit 8df6974 into denoland:main Sep 10, 2025
19 checks passed
@eryue0220 eryue0220 deleted the feat/expect-todo-update branch September 10, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants