obsidian-testing-framework 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { test as base, inject } from "vitest";
|
|
2
2
|
import { _electron as electron } from "playwright";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import os from "os";
|
|
4
5
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmdirSync, writeFileSync, } from "fs";
|
|
5
6
|
import { pageUtils, waitForIndexingComplete } from "./util.js";
|
|
6
7
|
import { randomBytes } from "crypto";
|
|
@@ -58,11 +59,11 @@ export const test = base.extend({
|
|
|
58
59
|
await run("");
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
const prefix = "obsidian-testing-framework-vault-pool-";
|
|
62
|
+
const prefix = path.join(os.tmpdir(), "obsidian-testing-framework-vault-pool-");
|
|
62
63
|
const vaultPoolDir = mkdtempSync(prefix);
|
|
63
64
|
await run(vaultPoolDir);
|
|
64
65
|
rmdirSync(vaultPoolDir, { recursive: true });
|
|
65
|
-
const configFile = findConfig();
|
|
66
|
+
const configFile = path.join(findConfig(), "obsidian.json");
|
|
66
67
|
const json = JSON.parse(readFileSync(configFile).toString());
|
|
67
68
|
const filtered = Object.fromEntries(Object.entries(json.vaults).filter(([, v]) => !v.path.includes(prefix)));
|
|
68
69
|
writeFileSync(configFile, JSON.stringify({ vaults: filtered }));
|