Skip to content

Commit

Permalink
test: fix some weird case failures
Browse files Browse the repository at this point in the history
Occasinally I see this in Linux, in debug mode:

at: <anonymous> (/home/runner/work/txiki.js/txiki.js/tests/test-env.js:5)
wanted: function TypeError() {
    [native code]
}
found: function Error() {
    [native code]
}
  • Loading branch information
saghul committed Mar 23, 2022
1 parent 262994d commit 703ac9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import assert from './assert.js';


(async () => {
assert.throws(() => { tjs.getenv() }, TypeError, 'must pass a string');
assert.throws(() => { tjs.getenv(1234) }, TypeError, 'must pass a string');
assert.throws(() => { tjs.getenv() }, Error, 'must pass a string');
assert.throws(() => { tjs.getenv(1234) }, Error, 'must pass a string');
assert.ok(tjs.getenv('PATH'));

assert.throws(() => { tjs.setenv() }, TypeError, 'must pass a string');
assert.throws(() => { tjs.setenv('FOO') }, TypeError, 'must pass a string');
assert.throws(() => { tjs.setenv() }, Error, 'must pass a string');
assert.throws(() => { tjs.setenv('FOO') }, Error, 'must pass a string');
tjs.setenv('FOO', 123);
tjs.setenv('FOO', 'BAR');

assert.throws(() => { tjs.unsetenv() }, TypeError, 'must pass a string');
assert.throws(() => { tjs.unsetenv(1234) }, TypeError, 'must pass a string');
assert.throws(() => { tjs.unsetenv() }, Error, 'must pass a string');
assert.throws(() => { tjs.unsetenv(1234) }, Error, 'must pass a string');
tjs.unsetenv('FOO');
})();

0 comments on commit 703ac9c

Please sign in to comment.