From bb8b11f54acdfcdeb279518605bcfaacf2545ed4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 4 Dec 2019 20:15:33 -0800 Subject: [PATCH] test: improve WASI options validation Refs: https://github.com/nodejs/node/pull/30770/files#r353051438 PR-URL: https://github.com/nodejs/node/pull/30800 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- test/wasi/test-wasi-options-validation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/wasi/test-wasi-options-validation.js b/test/wasi/test-wasi-options-validation.js index 34ab7e078f1210..f8ec2604d5b9f1 100644 --- a/test/wasi/test-wasi-options-validation.js +++ b/test/wasi/test-wasi-options-validation.js @@ -11,12 +11,12 @@ new WASI({}); // If args is not an Array and not undefined, it should throw. assert.throws(() => { new WASI({ args: 'fhqwhgads' }); }, - { code: 'ERR_INVALID_ARG_TYPE' }); + { code: 'ERR_INVALID_ARG_TYPE', message: /\bargs\b/ }); // If env is not an Object and not undefined, it should throw. assert.throws(() => { new WASI({ env: 'fhqwhgads' }); }, - { code: 'ERR_INVALID_ARG_TYPE' }); + { code: 'ERR_INVALID_ARG_TYPE', message: /\benv\b/ }); // If preopens is not an Object and not undefined, it should throw. assert.throws(() => { new WASI({ preopens: 'fhqwhgads' }); }, - { code: 'ERR_INVALID_ARG_TYPE' }); + { code: 'ERR_INVALID_ARG_TYPE', message: /\bpreopens\b/ });