-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test script and enable sourceMap in tsconfig
The test script in `src/__tests__/test.ts` has been updated for better functionality and improved plugin initialization. The `sourceMap` property in the `tsconfig.json` file has been set to `true` to generate corresponding '.map' files. The `Runtime` in `
- Loading branch information
1 parent
031226e
commit b78a8b5
Showing
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
test("4 greater than 1", async () => { | ||
expect(4).toBeGreaterThan(1); | ||
import { Context, PublicAPI, Query } from "@wox-launcher/wox-plugin" | ||
import { plugin } from "../index" | ||
|
||
test("query", async () => { | ||
const ctx = {} as Context | ||
const query = { | ||
Env: { "ActiveWindowTitle": "" }, | ||
RawQuery: "wpm install ", | ||
Selection: { Type: "text", Text: "", FilePaths: [] }, | ||
Type: "input", | ||
Search: "", | ||
TriggerKeyword: "wpm", | ||
Command: "install", | ||
IsGlobalQuery(): boolean { | ||
return false | ||
} | ||
} as Query | ||
|
||
await plugin.init(ctx, { | ||
PluginDirectory: "", API: { | ||
Log: (ctx, level, message) => { | ||
console.log(level, message) | ||
} | ||
} as PublicAPI | ||
}) | ||
const results = await plugin.query(ctx, query) | ||
expect(results.length).toBeGreaterThan(0) | ||
}) |
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