From d74584c53c024e6aad8ee9b6c92957836788f98f Mon Sep 17 00:00:00 2001 From: Scott Motte Date: Thu, 23 Oct 2025 14:25:25 -0700 Subject: [PATCH] additional tests --- tests/.env.expand | 3 ++- tests/lib/config-expand.test.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/.env.expand b/tests/.env.expand index b16fd2e9..2ab6a5fe 100644 --- a/tests/.env.expand +++ b/tests/.env.expand @@ -55,7 +55,8 @@ ONETWO_SIMPLE2=$ONE${TWO} ONETWO_SUPER_SIMPLE=$ONE$TWO TWO_DOLLAR_SIGNS_FOLLOWED_BY_DIGIT="abcd$$1234foo" -TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER="pa$" +TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER="pa$$word@" +TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER_SINGLE_QUOTE='pa$$word@' # https://github.com/motdotla/dotenv-expand/issues/80 DONT_CHOKE1='.kZh`>4[,[DDU-*Jt+[;8-,@K=,9%;F9KsoXqOE)gpG^X!{)Q+/9Fc(QF}i[NEi!' diff --git a/tests/lib/config-expand.test.js b/tests/lib/config-expand.test.js index ed0462b7..3f8663f1 100644 --- a/tests/lib/config-expand.test.js +++ b/tests/lib/config-expand.test.js @@ -293,7 +293,16 @@ t.test('handles two dollar signs followed by letter', ct => { const testPath = 'tests/.env.expand' const env = dotenvx.config({ path: testPath }) - ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER, 'pa$') + ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER, 'pa$@') + + ct.end() +}) + +t.test('handles two dollar signs followed by letter but single quoted', ct => { + const testPath = 'tests/.env.expand' + const env = dotenvx.config({ path: testPath }) + + ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER_SINGLE_QUOTE, 'pa$$word@') ct.end() })