-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbe605c
commit 76b2851
Showing
5 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { resolveValueToPromise } from '../../src/utils.js'; | ||
|
||
describe('resolveValueToPromise', () => { | ||
it('should resolve a static string value', async () => { | ||
const value = 'staticValue'; | ||
const result = await resolveValueToPromise(value); | ||
expect(result).toBe(value); | ||
}); | ||
|
||
it('should resolve a synchronous function returning a string', async () => { | ||
const value = 'syncValue'; | ||
const syncFunction = () => value; | ||
const result = await resolveValueToPromise(syncFunction); | ||
expect(result).toBe(value); | ||
}); | ||
|
||
it('should resolve an asynchronous function returning a string', async () => { | ||
const value = 'asyncValue'; | ||
const asyncFunction = async () => value; | ||
const result = await resolveValueToPromise(asyncFunction); | ||
expect(result).toBe(value); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters