TritonDataCenter/node-verror

Add more tests to tst.context.js

melloc opened this issue · 5 comments

While looking at tst.context.js, I realized that it could do with some better tests.

I don't think I follow the cases that the new tests are intended to address. Could you maybe add some comments explaining what the test is doing? Also, is there a reason to drop the isError check?

I dropped the isError() check because it wasn't testing anything from verror, but the dependency it's using. The tests I've added indirectly test isError() through the verror functions and constructors.

Thanks for the update! I moved the discussion to the CR. In summary, I prefer to keep the isError check but that's not a blocker.

I've run the test suite using several different versions of node:

% for arch in x86 x64; do for version in v0.10.48 v0.12.16 v4.8.1 v6.17.0 v8.15.1; do ( export PATH=$HOME/node-versions/node-$version-sunos-$arch/bin:$PATH; label="$(node -pe '[process.platform, process.arch, process.version].join(" ");')"; echo $label; ( echo $label; git reset --hard HEAD; git clean -fxd; V=1 npm install && make test ) &> "../output-$label.txt" ); done; done
sunos ia32 v0.10.48
sunos ia32 v0.12.16
sunos ia32 v4.8.1
sunos ia32 v6.17.0
sunos ia32 v8.15.1
sunos x64 v0.10.48
sunos x64 v0.12.16
sunos x64 v4.8.1
sunos x64 v6.17.0
sunos x64 v8.15.1

Looking at the results of the runs:

 % tail -n 8 output-sunos*
==> output-sunos ia32 v0.10.48.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos ia32 v0.12.16.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos ia32 v4.8.1.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos ia32 v6.17.0.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos ia32 v8.15.1.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos x64 v0.10.48.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos x64 v0.12.16.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos x64 v4.8.1.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos x64 v6.17.0.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.

==> output-sunos x64 v8.15.1.txt <==
===================================================

Results:
        Tests passed:    8/ 8
        Tests failed:    0/ 8

===================================================
Cleaning up output from successful tests ... done.