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
Adds js/unit_tests.ts #448
Conversation
cf82cef
to
badda40
Compare
8551164
to
1fcc498
Compare
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, but see comments.
js/testing/util.ts
Outdated
if (a === b) { | ||
return true; | ||
} | ||
if ( |
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.
I think I wrote this, so here's a comment to self:
The a === b
and isNan
cases can be folded into a single one: if (Object.is(a, b)) { return true; }
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.
Fixed.
tools/test.py
Outdated
sys.exit(1) | ||
|
||
|
||
def main(argv): | ||
if len(argv) != 2: | ||
print "Usage: tools/test.py [build dir]" | ||
build_dir = build_path() |
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.
I'd find it easier to reason about written like this:
if len(argv) == 2:
build_dir = sys.argv[1]
elif len(argv) == 1:
build_dir = build_path()
else:
print "Usage: tools/test.py [build_dir]"
sys.exit(1)
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.
Changed.
js/unit_tests.ts
Outdated
@@ -6,55 +6,12 @@ | |||
// serving the deno project directory. Try this: |
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.
stale comment?
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.
Removed
js/unit_tests.ts
Outdated
@@ -6,55 +6,12 @@ | |||
// serving the deno project directory. Try this: | |||
// http-server -p 4545 --cors . |
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.
idem
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.
?
js/testing/util.ts
Outdated
} | ||
|
||
// tslint:disable-next-line:no-any | ||
export function equal(c: any, d: any): boolean { |
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.
This would be a prime use case for the unknown
type (new in TypeScript 3).
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.
I couldn't get it to work immediately but I added a comment.
Depends on #434