From 703ac9c65859da04a66ad75b6a7fe873973c0372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 23 Mar 2022 09:20:19 +0100 Subject: [PATCH] test: fix some weird case failures Occasinally I see this in Linux, in debug mode: at: (/home/runner/work/txiki.js/txiki.js/tests/test-env.js:5) wanted: function TypeError() { [native code] } found: function Error() { [native code] } --- tests/test-env.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test-env.js b/tests/test-env.js index 1dbae3b3..c9f26c8d 100644 --- a/tests/test-env.js +++ b/tests/test-env.js @@ -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'); })();