-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Keyv.Options type incorrectly defines store option type (#405)
* Reproduce bad Store types issue * Fix Keyv.Options type incorrectly defines store option type
- Loading branch information
1 parent
6e26269
commit 4efe8e0
Showing
5 changed files
with
30 additions
and
5 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,18 @@ | ||
import test from 'ava'; | ||
import Keyv from 'keyv'; | ||
import KeyvRedis from '../src/index.js'; | ||
|
||
const redisHost = 'localhost'; | ||
const redisUri = `redis://${redisHost}`; | ||
|
||
type MyType = { | ||
a: string; | ||
}; | ||
|
||
test('can specify redis store in typescript', async t => { | ||
const keyv = new Keyv<MyType>({ | ||
store: new KeyvRedis(redisUri), | ||
}); | ||
|
||
t.true(await keyv.set('testkey', {a: 'testvalue'})); | ||
}); |
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