Testing module compatibility
See original GitHub issueAt the minute we don’t really seem to follow node’s assertion interfaces or anyone else’s.
Is there any reference as to what convention was followed or was it thought up just for deno?
It may be worth rewriting the testing module to adhere to node’s assertion module and be entirely compatible.
Basically current implementation:
assertEqual(actual, expected, msg);
assert(equal(actual, expected), msg);
Node implementation:
assert.equal(actual, expected, msg);
So:
assertEqual
doesn’t seem to be needed, only for setting a nice message (deepEqual and equal would do this themselves)equal
does a deep equality check for us but in node does anObject.is
alone (asdeepEqual
exists for the former)- An
AssertionError
is thrown rather than anError
in node - Negated functions exist in node such as
notEqual
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
What is Software Compatibility Testing?
Compatibility is non-functional testing to ensure customer satisfaction. It is to determine whether your software application or product is ...
Read more >What is a compatibility test? Definition from WhatIs.com.
A compatibility test is an assessment used to ensure a software application is properly working across different browsers, databases, operating systems (OS) ...
Read more >module compatibility test - YouTube
Product testing,module customer module test, every details Purchase directly: https://gzcom.en.alibaba. ... module compatibility test.
Read more >Compatibility Test Suite | Android Open Source Project
The Compatibility Test Suite (CTS) is a free, commercial-grade test suite, available for download as a binary or as source in the Android ......
Read more >CTS-D is a new Compatibility Test Suite module with tests ...
CTS-D is a new CTS module that includes compatibility tests written by app developers. It already consists of a few tests contributed by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Personally I would rather take queues from Chai assert personally.
The behaviour of
assertEqual()
andequal()
is already established, both in all ofstd
but also the core of Deno. There is a lot of tests that depend upon that deep comparison behaviour.I don’t think we should be pedantic about following anyone else’s behaviour. We can take queues and patterns from others. The benefit of TypeScript and JSDoc is that the APIs can be self documenting if there is any confusion.
The reason for
equal
being simple (value equality check, usually) is that we can then have adeepEqual
for when we want recursive equality checks. Leavingequal
to do a deep check seems fine as long as we then have astrictEqual
or similar, for when we don’t want deep equality (which would beObject.is
pretty much).I agree with your
rejects
idea, too, but it could be argued that both should be supported in that case. If dealing with promises directly, it sounds logical to haverejects
andresolves
, but if dealing with async functions, it sounds logical to havethrowsAsync
andreturnsAsync
. Really depends on what context you’re in.Anyhow, i’m happy to open a few issues separately about these things but the idea of this issue in particular was to identify what those are.
Also, there’s now
equal
andassert.equal
being exported which can be a little confusing (one doesn’t assert). It probably shouldn’t be exposed anymore but again would need a bunch of updates to other modules.