obsidian-testing-framework 0.0.7 → 0.1.0
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.d.ts +6 -2
- package/lib/index.js +6 -9
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { ObsidianTestFixtures } from "./fixtures.js";
|
|
2
1
|
export interface ObsidianTestingConfig {
|
|
3
2
|
vault?: string;
|
|
4
3
|
}
|
|
5
4
|
export declare function getExe(): string;
|
|
6
|
-
export declare const test: import("
|
|
5
|
+
export declare const test: import("vitest").TestAPI<{
|
|
6
|
+
page: import("playwright-core").Page;
|
|
7
|
+
obsidian: ObsidianTestingConfig;
|
|
8
|
+
electronApp: import("playwright-core").ElectronApplication;
|
|
9
|
+
appHandle: import("playwright-core").JSHandle<import("obsidian").App>;
|
|
10
|
+
}>;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { test as base } from "
|
|
1
|
+
import { test as base, inject } from "vitest";
|
|
2
2
|
import { _electron as electron } from "playwright";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -63,9 +63,11 @@ function generateVaultConfig(vault) {
|
|
|
63
63
|
return Object.entries(json.vaults).find(a => a[1].path === vault)[0];
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
// @ts-ignore some error about a string type now having `undefined` as part of it's union
|
|
67
|
+
export const test = base.extend({
|
|
67
68
|
electronApp: [
|
|
68
|
-
async (
|
|
69
|
+
async (_, run) => {
|
|
70
|
+
const { vault } = inject("obsidian");
|
|
69
71
|
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = "true";
|
|
70
72
|
console.log("asar located at:", getExe());
|
|
71
73
|
let uriArg = "";
|
|
@@ -86,7 +88,6 @@ const obsidianTestFixtures = {
|
|
|
86
88
|
await run(electronApp);
|
|
87
89
|
await electronApp.close();
|
|
88
90
|
},
|
|
89
|
-
{ timeout: 60000 },
|
|
90
91
|
],
|
|
91
92
|
page: [
|
|
92
93
|
async ({ electronApp }, run) => {
|
|
@@ -112,9 +113,5 @@ const obsidianTestFixtures = {
|
|
|
112
113
|
});
|
|
113
114
|
await run(page);
|
|
114
115
|
},
|
|
115
|
-
{ timeout: 60000 },
|
|
116
116
|
],
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
// @ts-ignore some error about a string type now having `undefined` as part of it's union
|
|
120
|
-
export const test = base.extend(obsidianTestFixtures);
|
|
117
|
+
});
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"../../README.md"
|
|
20
20
|
],
|
|
21
21
|
"readme": "",
|
|
22
|
-
"version": "0.0
|
|
22
|
+
"version": "0.1.0",
|
|
23
23
|
"main": "./lib/index.js",
|
|
24
24
|
"typings": "./lib/index.d.ts",
|
|
25
25
|
"scripts": {
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/tmp": "^0",
|
|
32
32
|
"rimraf": "^6.0.1",
|
|
33
|
-
"vitest": "^2.1.
|
|
33
|
+
"vitest": "^2.1.4"
|
|
34
34
|
}
|
|
35
35
|
}
|