-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add console.assert
#102
Add console.assert
#102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you : )
btw, can we have tests?
(you should make a ts file inside testdata
dir and save your expected output in some other files with the same name and a .out
extension.
as an example: ./testdata/a.ts
./testdata/a.ts.out
)
@qti3e Can you review again please? |
testdata/013_console_assert.ts.out
Outdated
@@ -0,0 +1 @@ | |||
You will see me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will be: "Assertion failed: You will see me. "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do:
../deno 013_console_assert.ts > 013_console_assert.ts.out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that is my fault. I will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@g-plane No problem : )
CI passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for addressing my concerns about the test.
https://developer.mozilla.org/en-US/docs/Web/API/console/assert Do we need follow the naming and full implementation? This patch seems not do like this. |
@yorkie Can you give some examples? |
Thanks! I'd rather this was tested in tests.ts. The |
@ry If we put it into |
@g-plane It should throw - sorry didn't catch that it didn't before - and you can use a try-catch to test it. |
@ry Updated and CI passed. |
@g-plane Thanks! |
…and#102) * feat(core): Add resource_handle (prereq for fast streams work) * fmt * ResourceHandleFd allows for removal of cfg * Add missing exports, re-try windows * reattempt windows * Add get_fd/get_handle/get_socket to ResourceTable
I'm not sure that if the assertion failed an error should be thrown.