Compare commits
3 Commits
be6447d3ce
...
13c76cf3e5
Author | SHA1 | Date | |
---|---|---|---|
13c76cf3e5 | |||
120ba3482c | |||
08c244ab9d |
2
.github/workflows/playwright.yml
vendored
2
.github/workflows/playwright.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: compile and test!
|
- name: compile and test!
|
||||||
run: |
|
run: |
|
||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
yarn workspace obsidian-testing-framework run tsc
|
yarn workspace obsidian-testing-library run tsc
|
||||||
yarn workspace obsidian-sample-plugin run test
|
yarn workspace obsidian-sample-plugin run test
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
BIN
.yarn/install-state.gz
vendored
BIN
.yarn/install-state.gz
vendored
Binary file not shown.
@ -10,7 +10,7 @@ which is an Electron app under the hood.
|
|||||||
|
|
||||||
### basic usage
|
### basic usage
|
||||||
```ts
|
```ts
|
||||||
import {test} from "obsidian-testing-framework";
|
import {test} from "obsidian-testing-library";
|
||||||
test('obsidian app url', async ({ page }) => {
|
test('obsidian app url', async ({ page }) => {
|
||||||
console.log(page.url());
|
console.log(page.url());
|
||||||
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
|
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
|
||||||
@ -23,7 +23,7 @@ test("idk", async({page}) => {
|
|||||||
let tfile = await doWithApp(page, async (app) => {
|
let tfile = await doWithApp(page, async (app) => {
|
||||||
return app.metadataCache.getFirstLinkpathDest("Welcome", "/");
|
return app.metadataCache.getFirstLinkpathDest("Welcome", "/");
|
||||||
});
|
});
|
||||||
expect(what.basename).toEqual("Welcome")
|
expect(tfile.basename).toEqual("Welcome")
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-testing-framework-parent",
|
"name": "obsidian-testing-library-parent",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "yarn@4.5.1",
|
"packageManager": "yarn@4.5.1",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
3
packages/obsidian-testing-framework/.npmignore
Normal file
3
packages/obsidian-testing-framework/.npmignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
tsconfig.json
|
||||||
|
src/**/*
|
||||||
|
typings/**/*
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-testing-framework",
|
"name": "obsidian-testing-library",
|
||||||
"packageManager": "yarn@4.5.1",
|
"packageManager": "yarn@4.5.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/language": "https://github.com/lishid/cm-language",
|
"@codemirror/language": "https://github.com/lishid/cm-language",
|
||||||
@ -14,6 +14,9 @@
|
|||||||
"typescript": "^5.6.3",
|
"typescript": "^5.6.3",
|
||||||
"xvfb-maybe": "^0.2.1"
|
"xvfb-maybe": "^0.2.1"
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"./lib"
|
||||||
|
],
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
@ -34,10 +37,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "tslint -c tslint.json src/**/*.ts",
|
"lint": "tslint -c tslint.json src/**/*.ts",
|
||||||
"prepublish": "npm run build"
|
"prepare": "yarn rimraf lib && yarn build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/tmp": "^0",
|
"@types/tmp": "^0",
|
||||||
|
"rimraf": "^6.0.1",
|
||||||
"vitest": "^2.1.3"
|
"vitest": "^2.1.3"
|
||||||
},
|
},
|
||||||
"type": "module"
|
"type": "module"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import {test} from "obsidian-testing-framework"
|
import {test} from "obsidian-testing-library"
|
||||||
import {TFile} from "obsidian";
|
import {TFile} from "obsidian";
|
||||||
import {assertLineEquals, doWithApp, readFile} from "obsidian-testing-framework/utils";
|
import {assertLineEquals, doWithApp, readFile} from "obsidian-testing-library/utils";
|
||||||
test('something', async ({ page }) => {
|
test('something', async ({ page }) => {
|
||||||
console.log(page.url());
|
console.log(page.url());
|
||||||
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
|
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"obsidian-testing-framework": "workspace:^"
|
"obsidian-testing-library": "workspace:^"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.48.1",
|
"@playwright/test": "^1.48.1",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineConfig, devices } from '@playwright/test';
|
import { defineConfig, devices } from '@playwright/test';
|
||||||
import {ObsidianTestFixtures} from "obsidian-testing-framework/fixture";
|
import {ObsidianTestFixtures} from "obsidian-testing-library/fixture";
|
||||||
import os from "os"
|
import os from "os"
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
74
yarn.lock
74
yarn.lock
@ -1833,6 +1833,22 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"glob@npm:^11.0.0":
|
||||||
|
version: 11.0.0
|
||||||
|
resolution: "glob@npm:11.0.0"
|
||||||
|
dependencies:
|
||||||
|
foreground-child: "npm:^3.1.0"
|
||||||
|
jackspeak: "npm:^4.0.1"
|
||||||
|
minimatch: "npm:^10.0.0"
|
||||||
|
minipass: "npm:^7.1.2"
|
||||||
|
package-json-from-dist: "npm:^1.0.0"
|
||||||
|
path-scurry: "npm:^2.0.0"
|
||||||
|
bin:
|
||||||
|
glob: dist/esm/bin.mjs
|
||||||
|
checksum: 10c0/419866015d8795258a8ac51de5b9d1a99c72634fc3ead93338e4da388e89773ab21681e494eac0fbc4250b003451ca3110bb4f1c9393d15d14466270094fdb4e
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"glob@npm:^7.1.6":
|
"glob@npm:^7.1.6":
|
||||||
version: 7.2.3
|
version: 7.2.3
|
||||||
resolution: "glob@npm:7.2.3"
|
resolution: "glob@npm:7.2.3"
|
||||||
@ -2110,6 +2126,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"jackspeak@npm:^4.0.1":
|
||||||
|
version: 4.0.2
|
||||||
|
resolution: "jackspeak@npm:4.0.2"
|
||||||
|
dependencies:
|
||||||
|
"@isaacs/cliui": "npm:^8.0.2"
|
||||||
|
checksum: 10c0/b26039d11c0163a95b1e58851b9ac453cce64ad6d1eb98a00b303ad5eeb761b29d33c9419d1e16c016d3f7151c8edf7df223e6cf93a1907655fd95d6ce85c0de
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"jsbn@npm:1.1.0":
|
"jsbn@npm:1.1.0":
|
||||||
version: 1.1.0
|
version: 1.1.0
|
||||||
resolution: "jsbn@npm:1.1.0"
|
resolution: "jsbn@npm:1.1.0"
|
||||||
@ -2173,6 +2198,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"lru-cache@npm:^11.0.0":
|
||||||
|
version: 11.0.1
|
||||||
|
resolution: "lru-cache@npm:11.0.1"
|
||||||
|
checksum: 10c0/8bad6603dc67eb5b03520fba05bce5df6473dbba58ac4c6067ed088d29225a0a04416bb1462acd8c1f819d1fbf37920446a1c36bafd9c384bcc54cee0d3b697a
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"magic-string@npm:^0.30.11":
|
"magic-string@npm:^0.30.11":
|
||||||
version: 0.30.12
|
version: 0.30.12
|
||||||
resolution: "magic-string@npm:0.30.12"
|
resolution: "magic-string@npm:0.30.12"
|
||||||
@ -2242,6 +2274,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"minimatch@npm:^10.0.0":
|
||||||
|
version: 10.0.1
|
||||||
|
resolution: "minimatch@npm:10.0.1"
|
||||||
|
dependencies:
|
||||||
|
brace-expansion: "npm:^2.0.1"
|
||||||
|
checksum: 10c0/e6c29a81fe83e1877ad51348306be2e8aeca18c88fdee7a99df44322314279e15799e41d7cb274e4e8bb0b451a3bc622d6182e157dfa1717d6cda75e9cd8cd5d
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1":
|
"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1":
|
||||||
version: 3.1.2
|
version: 3.1.2
|
||||||
resolution: "minimatch@npm:3.1.2"
|
resolution: "minimatch@npm:3.1.2"
|
||||||
@ -2446,7 +2487,7 @@ __metadata:
|
|||||||
builtin-modules: "npm:3.3.0"
|
builtin-modules: "npm:3.3.0"
|
||||||
esbuild: "npm:0.17.3"
|
esbuild: "npm:0.17.3"
|
||||||
obsidian: "npm:latest"
|
obsidian: "npm:latest"
|
||||||
obsidian-testing-framework: "workspace:^"
|
obsidian-testing-library: "workspace:^"
|
||||||
playwright: "npm:^1.48.1"
|
playwright: "npm:^1.48.1"
|
||||||
tslib: "npm:2.4.0"
|
tslib: "npm:2.4.0"
|
||||||
typescript: "npm:4.7.4"
|
typescript: "npm:4.7.4"
|
||||||
@ -2455,15 +2496,15 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"obsidian-testing-framework-parent@workspace:.":
|
"obsidian-testing-library-parent@workspace:.":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "obsidian-testing-framework-parent@workspace:."
|
resolution: "obsidian-testing-library-parent@workspace:."
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"obsidian-testing-framework@workspace:^, obsidian-testing-framework@workspace:packages/obsidian-testing-framework":
|
"obsidian-testing-library@workspace:^, obsidian-testing-library@workspace:packages/obsidian-testing-framework":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "obsidian-testing-framework@workspace:packages/obsidian-testing-framework"
|
resolution: "obsidian-testing-library@workspace:packages/obsidian-testing-framework"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@codemirror/language": "https://github.com/lishid/cm-language"
|
"@codemirror/language": "https://github.com/lishid/cm-language"
|
||||||
"@codemirror/state": "npm:^6.0.1"
|
"@codemirror/state": "npm:^6.0.1"
|
||||||
@ -2474,6 +2515,7 @@ __metadata:
|
|||||||
electron: "npm:^33.0.2"
|
electron: "npm:^33.0.2"
|
||||||
obsidian: "npm:latest"
|
obsidian: "npm:latest"
|
||||||
playwright: "npm:^1.48.1"
|
playwright: "npm:^1.48.1"
|
||||||
|
rimraf: "npm:^6.0.1"
|
||||||
tmp: "npm:^0.2.3"
|
tmp: "npm:^0.2.3"
|
||||||
typescript: "npm:^5.6.3"
|
typescript: "npm:^5.6.3"
|
||||||
vitest: "npm:^2.1.3"
|
vitest: "npm:^2.1.3"
|
||||||
@ -2550,6 +2592,16 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"path-scurry@npm:^2.0.0":
|
||||||
|
version: 2.0.0
|
||||||
|
resolution: "path-scurry@npm:2.0.0"
|
||||||
|
dependencies:
|
||||||
|
lru-cache: "npm:^11.0.0"
|
||||||
|
minipass: "npm:^7.1.2"
|
||||||
|
checksum: 10c0/3da4adedaa8e7ef8d6dc4f35a0ff8f05a9b4d8365f2b28047752b62d4c1ad73eec21e37b1579ef2d075920157856a3b52ae8309c480a6f1a8bbe06ff8e52b33c
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"path-type@npm:^4.0.0":
|
"path-type@npm:^4.0.0":
|
||||||
version: 4.0.0
|
version: 4.0.0
|
||||||
resolution: "path-type@npm:4.0.0"
|
resolution: "path-type@npm:4.0.0"
|
||||||
@ -2712,6 +2764,18 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"rimraf@npm:^6.0.1":
|
||||||
|
version: 6.0.1
|
||||||
|
resolution: "rimraf@npm:6.0.1"
|
||||||
|
dependencies:
|
||||||
|
glob: "npm:^11.0.0"
|
||||||
|
package-json-from-dist: "npm:^1.0.0"
|
||||||
|
bin:
|
||||||
|
rimraf: dist/esm/bin.mjs
|
||||||
|
checksum: 10c0/b30b6b072771f0d1e73b4ca5f37bb2944ee09375be9db5f558fcd3310000d29dfcfa93cf7734d75295ad5a7486dc8e40f63089ced1722a664539ffc0c3ece8c6
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"roarr@npm:^2.15.3":
|
"roarr@npm:^2.15.3":
|
||||||
version: 2.15.4
|
version: 2.15.4
|
||||||
resolution: "roarr@npm:2.15.4"
|
resolution: "roarr@npm:2.15.4"
|
||||||
|
Loading…
Reference in New Issue
Block a user