Skip to content

Conversation

@bcheidemann
Copy link
Contributor

Closes #2214

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.

@bcheidemann Thanks for the PR. The API design and testing look good to me. Nice work!

Can you also add docs in testing/README.md?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Looking good!


/** Executes a function which returns a promise, expecting it to reject. */
export function assertRejects(
export function assertRejects<T = unknown>(
Copy link
Member

Choose a reason for hiding this comment

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

Seems like an unrelated change, what's the reason for it?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, probably it's better to keep this unknown as the thrown value is not type checked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging, I will remove this change and refactor the test to use the format outlined below

name: "[MISSING SNAPSHOT]",
});

const err = await assertRejects<AssertionError>(async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Let's use assertRejects(fn, AssertionError) call, that will give correct type to err

@bcheidemann
Copy link
Contributor Author

@bcheidemann Thanks for the PR. The API design and testing look good to me. Nice work!

Can you also add docs in testing/README.md?

Yeah no problem :)

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.

LGTM!

snapshot files. As such, the allow list for `--allow-read` and `--allow-write`
can be limited to only include existing snapshot files, if so desired.

### Options:
Copy link
Member

Choose a reason for hiding this comment

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

Nice docs!

@kt3k kt3k merged commit 583554d into denoland:main Jul 2, 2022
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

Successfully merging this pull request may close these issues.

testing/snapshot: "assertSnapshot" should have a way to set options in a persistent way

3 participants