From 364eb7996fd6c42fd0c52e149c2e4c4b4dc0d316 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Wed, 24 Jan 2024 07:35:46 -0800 Subject: [PATCH] Fix async bug in cred check callback tests --- test/banner/check-creds-test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/banner/check-creds-test.js b/test/banner/check-creds-test.js index 43772cc..61198e1 100644 --- a/test/banner/check-creds-test.js +++ b/test/banner/check-creds-test.js @@ -51,8 +51,8 @@ test('Credential checks (async)', async t => { reset(t) }) -test('Credential checks (callback)', t => { - t.plan(2) +test('Credential checks (callback, via env)', t => { + t.plan(1) // Count on aws-lite finding creds (via env) process.env.AWS_ACCESS_KEY_ID = 'yo' @@ -62,7 +62,10 @@ test('Credential checks (callback)', t => { if (err) t.fail(err) else t.pass('No credential loading error reported') }) +}) +test('Credential checks (callback failure, via profile)', t => { + t.plan(1) // Fail a cred check reset(t) process.env.AWS_PROFILE = 'random_profile_name_that_does_not_exist'