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

Improve assert #124

Merged
merged 1 commit into from
Jan 16, 2019
Merged

Improve assert #124

merged 1 commit into from
Jan 16, 2019

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Jan 16, 2019

This PR improves assert in the testing module.

It decorates the assert function with three additional functions for assertion:

  • assert.equal() - This is the same as assertEqual() already present.
  • assert.strictEqual() - This checks that actual and expected are strictly equal.
  • assert.throws() - This takes a function which is expected to throw. If it does not, then the assertion will throw. It can also take optional error class, where the class of the thrown error is checked, and a string which should be included in the thrown error message.

testing/README.md Outdated Show resolved Hide resolved
testing/mod.ts Show resolved Hide resolved
testing/mod.ts Show resolved Hide resolved
testing/README.md Show resolved Hide resolved
testing/test.ts Show resolved Hide resolved
testing/test.ts Show resolved Hide resolved
testing/test.ts Show resolved Hide resolved
testing/test.ts Outdated Show resolved Hide resolved
@kitsonk
Copy link
Contributor Author

kitsonk commented Jan 16, 2019

@ry counters added

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit 9a3eb20 into denoland:master Jan 16, 2019
ry pushed a commit to ry/deno that referenced this pull request Oct 9, 2019
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.

2 participants