-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposed resumable task store in config
- Loading branch information
1 parent
bcd669b
commit c25f790
Showing
5 changed files
with
37 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { ResumableTaskStore } from "@tbd54566975/dwn-sdk-js"; | ||
import { ResumableTaskStoreSql } from "@tbd54566975/dwn-sql-store"; | ||
import { getDialectFromUrl } from "../../src/storage.js"; | ||
|
||
/** | ||
* An example of a plugin that is used for testing. | ||
* The points to note are: | ||
* - The class must be a default export. | ||
* - The constructor must not take any arguments. | ||
*/ | ||
export default class ResumableTaskStoreSqlite extends ResumableTaskStoreSql implements ResumableTaskStore { | ||
constructor() { | ||
const sqliteDialect = getDialectFromUrl(new URL('sqlite://')); | ||
super(sqliteDialect); | ||
|
||
// NOTE: the following line is added purely to test the constructor invocation. | ||
ResumableTaskStoreSqlite.spyingTheConstructor(); | ||
} | ||
|
||
/** | ||
* NOTE: This method is introduced purely to indirectly test/spy invocation of the constructor. | ||
* As I was unable to find an easy way to directly spy the constructor. | ||
*/ | ||
public static spyingTheConstructor(): void { | ||
} | ||
} |
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