-
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.
- Loading branch information
1 parent
f41a371
commit aea158e
Showing
3 changed files
with
10 additions
and
8 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,11 +1,12 @@ | ||
const assert = require("node:assert"); | ||
const { getHistory, pushToHistory } = require("../../src/api/history"); | ||
|
||
test("history saves to file", async () => { | ||
it("saves history to file", async () => { | ||
const query = "select * from test"; | ||
|
||
await pushToHistory(query); | ||
|
||
const history = await getHistory(); | ||
|
||
expect(history.includes(query)).toBe(true); | ||
assert(history.includes(query)); | ||
}); |
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,11 +1,12 @@ | ||
const assert = require("node:assert"); | ||
const configHook = require("../../src/hooks/config"); | ||
|
||
test("config hook", async () => { | ||
it("sets config to global object", async () => { | ||
const options = { | ||
config: { configDir: "config" }, | ||
}; | ||
|
||
await configHook(options); | ||
|
||
expect(global.config).toEqual(options.config); | ||
assert.equal(global.config, options.config); | ||
}); |