Skip to content

Commit

Permalink
test: adjust to function
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Dec 25, 2023
1 parent fe61a41 commit 7c4605d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/custom/file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"hello": "world"
}
10 changes: 8 additions & 2 deletions test/read.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import { test } from 'node:test'
import assert from 'node:assert/strict'
import readFixtures from '../index.js'

test('readFixtures', async () => {
test('readFixtures with default folder', async () => {
const expected = { hello: 'world' }
const actual = await readFixtures('fixtures', 'file.json')
const actual = await readFixtures('file.json')
assert.deepEqual(actual, expected)
})

test('readFixtures with custom folder', async () => {
const expected = { hello: 'world' }
const actual = await readFixtures('file.json', 'custom')
assert.deepEqual(actual, expected)
})

0 comments on commit 7c4605d

Please sign in to comment.