Skip to content

Commit

Permalink
Show failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Nov 19, 2023
1 parent f46336f commit dfaa11d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASIC=local_basic
LOCAL=local
18 changes: 18 additions & 0 deletions tests/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ t.test('takes string for path option', ct => {
ct.equal(readFileSyncStub.args[0][0], testPath)
})

t.test('takes array for path option', ct => {
ct.plan(1)

const testPath = ['tests/.env']
dotenv.config({ path: testPath })

ct.equal(readFileSyncStub.args[0][0], testPath)
})

t.test('takes two or more files in the array for path option', ct => {
ct.plan(1)

const testPath = ['tests/.env.local', 'tests/.env']
dotenv.config({ path: testPath })

ct.equal(readFileSyncStub.args[0][0], testPath)
})

t.test('takes URL for path option', ct => {
ct.plan(1)

Expand Down

0 comments on commit dfaa11d

Please sign in to comment.