Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/fresh-install-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ name: Fresh Install Tests
# so test tooling churn doesn't cause false positives.

on:
push:
branches:
- package-upgrades
schedule:
- cron: "0 2 * * *" # Daily at 02:00 UTC
workflow_dispatch: # Allow manual runs
Expand Down Expand Up @@ -67,6 +64,19 @@ jobs:
echo "Updating prod deps for: $FILTERS"
eval pnpm update --prod $FILTERS

- id: dedupe_deps
name: Dedupe transitive dependencies
# After bumping the publishable packages' prod deps, collapse any
# duplicate transitive resolutions (e.g. @tiptap/core + @tiptap/pm)
# that would otherwise differ between the updated publishable packages
# and the un-updated examples/playground. Without this, TypeScript
# treats the two copies' exports as unrelated types and example-editor
# fails to build (TS2322 on Extension<any, any> vs AnyExtension).
# Dedupe only rewrites the lockfile — it does NOT modify package.json,
# so the examples' "@blocknote/*": "latest" specs (which is what
# CodeSandbox users see) stay intact.
run: pnpm dedupe

- id: build_packages
name: Build packages
run: pnpm run build
Expand Down Expand Up @@ -106,6 +116,8 @@ jobs:
failed_step="Install dependencies"
elif [ "${{ steps.update_prod_deps.outcome }}" = "failure" ]; then
failed_step="Update prod deps of published packages"
elif [ "${{ steps.dedupe_deps.outcome }}" = "failure" ]; then
failed_step="Dedupe transitive dependencies"
elif [ "${{ steps.build_packages.outcome }}" = "failure" ]; then
failed_step="Build packages"
elif [ "${{ steps.run_unit_tests.outcome }}" = "failure" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Selection } from "prosemirror-state";
import { describe, expect, it } from "vitest";
import { afterEach, describe, expect, it } from "vitest";

import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";

Expand All @@ -9,9 +9,22 @@ import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";

const PLUGIN_KEY = "numbered-list-indexing-decorations$";

// Track editors created in each test so we can unmount them in afterEach —
// otherwise prosemirror-view's DOMObserver leaves a setTimeout alive that
// fires after vitest tears down jsdom, throwing
// `ReferenceError: document is not defined` and failing the run.
const activeEditors: BlockNoteEditor<any, any, any>[] = [];

afterEach(() => {
while (activeEditors.length) {
activeEditors.pop()!.unmount();
}
});

function createEditor() {
const editor = BlockNoteEditor.create();
editor.mount(document.createElement("div"));
activeEditors.push(editor);
return editor;
}

Expand Down
Loading