Skip to content

feat(testing/unstable): add it.todo test.todo and describe.todo API #6712

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

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.

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