Compare commits

...

3 Commits

Author SHA1 Message Date
13c76cf3e5
rename framework->library
All checks were successful
Playwright Tests / test (push) Successful in 2m31s
i fucked up the npm publish; will revert when i'm allowed to republish
2024-10-24 21:34:55 -04:00
120ba3482c
prepare for publishing 2024-10-24 21:34:15 -04:00
08c244ab9d
fix incorrect readme example 2024-10-24 21:32:24 -04:00
10 changed files with 87 additions and 16 deletions

@ -28,7 +28,7 @@ jobs:
- name: compile and test!
run: |
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
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}

BIN
.yarn/install-state.gz vendored

Binary file not shown.

@ -10,7 +10,7 @@ which is an Electron app under the hood.
### basic usage
```ts
import {test} from "obsidian-testing-framework";
import {test} from "obsidian-testing-library";
test('obsidian app url', async ({ page }) => {
console.log(page.url());
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
@ -20,10 +20,10 @@ test('obsidian app url', async ({ page }) => {
```ts
test("idk", async({page}) => {
console.log("idk")
let tfile = await doWithApp(page,async (app) => {
let tfile = await doWithApp(page, async (app) => {
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,
"packageManager": "yarn@4.5.1",
"workspaces": [

@ -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",
"dependencies": {
"@codemirror/language": "https://github.com/lishid/cm-language",
@ -14,6 +14,9 @@
"typescript": "^5.6.3",
"xvfb-maybe": "^0.2.1"
},
"files": [
"./lib"
],
"version": "0.0.1",
"exports": {
".": {
@ -34,10 +37,11 @@
"scripts": {
"build": "tsc",
"lint": "tslint -c tslint.json src/**/*.ts",
"prepublish": "npm run build"
"prepare": "yarn rimraf lib && yarn build"
},
"devDependencies": {
"@types/tmp": "^0",
"rimraf": "^6.0.1",
"vitest": "^2.1.3"
},
"type": "module"

@ -1,7 +1,7 @@
import { expect } from '@playwright/test';
import {test} from "obsidian-testing-framework"
import {test} from "obsidian-testing-library"
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 }) => {
console.log(page.url());
expect(/obsidian\.md/i.test(page.url())).toBeTruthy()

@ -14,7 +14,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"obsidian-testing-framework": "workspace:^"
"obsidian-testing-library": "workspace:^"
},
"devDependencies": {
"@playwright/test": "^1.48.1",

@ -1,5 +1,5 @@
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 path from 'path';

@ -1833,6 +1833,22 @@ __metadata:
languageName: node
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":
version: 7.2.3
resolution: "glob@npm:7.2.3"
@ -2110,6 +2126,15 @@ __metadata:
languageName: node
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":
version: 1.1.0
resolution: "jsbn@npm:1.1.0"
@ -2173,6 +2198,13 @@ __metadata:
languageName: node
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":
version: 0.30.12
resolution: "magic-string@npm:0.30.12"
@ -2242,6 +2274,15 @@ __metadata:
languageName: node
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":
version: 3.1.2
resolution: "minimatch@npm:3.1.2"
@ -2446,7 +2487,7 @@ __metadata:
builtin-modules: "npm:3.3.0"
esbuild: "npm:0.17.3"
obsidian: "npm:latest"
obsidian-testing-framework: "workspace:^"
obsidian-testing-library: "workspace:^"
playwright: "npm:^1.48.1"
tslib: "npm:2.4.0"
typescript: "npm:4.7.4"
@ -2455,15 +2496,15 @@ __metadata:
languageName: unknown
linkType: soft
"obsidian-testing-framework-parent@workspace:.":
"obsidian-testing-library-parent@workspace:.":
version: 0.0.0-use.local
resolution: "obsidian-testing-framework-parent@workspace:."
resolution: "obsidian-testing-library-parent@workspace:."
languageName: unknown
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
resolution: "obsidian-testing-framework@workspace:packages/obsidian-testing-framework"
resolution: "obsidian-testing-library@workspace:packages/obsidian-testing-framework"
dependencies:
"@codemirror/language": "https://github.com/lishid/cm-language"
"@codemirror/state": "npm:^6.0.1"
@ -2474,6 +2515,7 @@ __metadata:
electron: "npm:^33.0.2"
obsidian: "npm:latest"
playwright: "npm:^1.48.1"
rimraf: "npm:^6.0.1"
tmp: "npm:^0.2.3"
typescript: "npm:^5.6.3"
vitest: "npm:^2.1.3"
@ -2550,6 +2592,16 @@ __metadata:
languageName: node
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":
version: 4.0.0
resolution: "path-type@npm:4.0.0"
@ -2712,6 +2764,18 @@ __metadata:
languageName: node
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":
version: 2.15.4
resolution: "roarr@npm:2.15.4"