no test-information printed in prosemirror-view project when run 'npm run test' #3

Closed
opened 2025-02-20 12:08:39 +01:00 by yoophoon · 5 comments
yoophoon commented 2025-02-20 12:08:39 +01:00 (Migrated from github.com)

only webtest-decoration.js prints test-information and the other test files log nothing

PS C:\Users\yoophoon\Desktop\prosemirror-view-master> npm run test

> prosemirror-view@1.33.6 test
> pm-runtests


DevTools listening on ws://127.0.0.1:63536/devtools/browser/c69adaef-18b4-4adb-b3f8-a299f78c5eac


  Browser tests (chrome)

      DecorationSet
        ✔ builds up a matching tree
        ✔ does not build nodes when there are no decorations
        ✔ puts decorations between children in local
        ✔ puts decorations spanning children in local
        ✔ puts node decorations in the parent node
        ✔ drops empty inline decorations
        find
          ✔ finds all when no arguments are given
          ✔ finds only those within the given range
          ✔ finds decorations at the edge of the range
          ✔ returns the correct offset for deeply nested decorations
          ✔ can filter by predicate
        map
          ✔ supports basic mapping
          ✔ drops deleted decorations
          ✔ can map node decorations
          ✔ can map inside node decorations
          ✔ removes partially overwritten node decorations
          ✔ removes exactly overwritten node decorations
          ✔ isn't inclusive by default
          ✔ understands unclusiveLeft
          ✔ understands unclusiveRight
          ✔ preserves subtrees not touched by mapping
          ✔ rebuilds when a node is joined
          ✔ rebuilds when a node is split
          ✔ correctly rebuilds a deep structure
          ✔ calls onRemove when dropping decorations
          ✔ respects the side option on widgets
          ✔ doesn't doubly map decorations nested in multiple nodes
          ✔ rebuilds subtrees correctly at an offset
          ✔ properly maps decorations after deleted siblings
          ✔ can map the content of nodes that moved in the same transaction
          ✔ can handle nodes moving up multiple levels
          ✔ maps inline decorations through ranges with > 3 elements
          ✔ correctly offsets a deep structure
          ✔ doesn't get confused by composite changes
        add
          ✔ can add a local decoration
          ✔ can add a decoration in a new child
          ✔ can add a decoration to an existing child
          ✔ can add a decoration beyond an existing child
          ✔ can add multiple decorations
        remove
          ✔ can delete a decoration
          ✔ can delete multiple decorations
          ✔ ignores decorations that don't exist
          ✔ compares by both position and type when removing
      removeOverlap
        ✔ returns the original array when there is no overlap
        ✔ splits a partially overlapping decoration
        ✔ splits a decoration that spans multiple widgets
        ✔ correctly splits overlapping inline decorations


  47 passing (25ms)

PS C:\Users\yoophoon\Desktop\prosemirror-view-master>

i've checked the test files, the trouble seems caused by import {tempEditor} from "./view" for those files with this line log nothing,and i've tried npm run test -- --server

PS C:\Users\yoophoon\Desktop\prosemirror-view-master> npm run test -- --server

> prosemirror-view@1.33.6 test
> pm-runtests --server        

Test server running on port 53871

Image

Image

Image

i've tried to copy the code in ./test/view.ts into those file taht import the code and those files loged test-information

only webtest-decoration.js prints test-information and the other test files log nothing ```shell PS C:\Users\yoophoon\Desktop\prosemirror-view-master> npm run test > prosemirror-view@1.33.6 test > pm-runtests DevTools listening on ws://127.0.0.1:63536/devtools/browser/c69adaef-18b4-4adb-b3f8-a299f78c5eac Browser tests (chrome) DecorationSet ✔ builds up a matching tree ✔ does not build nodes when there are no decorations ✔ puts decorations between children in local ✔ puts decorations spanning children in local ✔ puts node decorations in the parent node ✔ drops empty inline decorations find ✔ finds all when no arguments are given ✔ finds only those within the given range ✔ finds decorations at the edge of the range ✔ returns the correct offset for deeply nested decorations ✔ can filter by predicate map ✔ supports basic mapping ✔ drops deleted decorations ✔ can map node decorations ✔ can map inside node decorations ✔ removes partially overwritten node decorations ✔ removes exactly overwritten node decorations ✔ isn't inclusive by default ✔ understands unclusiveLeft ✔ understands unclusiveRight ✔ preserves subtrees not touched by mapping ✔ rebuilds when a node is joined ✔ rebuilds when a node is split ✔ correctly rebuilds a deep structure ✔ calls onRemove when dropping decorations ✔ respects the side option on widgets ✔ doesn't doubly map decorations nested in multiple nodes ✔ rebuilds subtrees correctly at an offset ✔ properly maps decorations after deleted siblings ✔ can map the content of nodes that moved in the same transaction ✔ can handle nodes moving up multiple levels ✔ maps inline decorations through ranges with > 3 elements ✔ correctly offsets a deep structure ✔ doesn't get confused by composite changes add ✔ can add a local decoration ✔ can add a decoration in a new child ✔ can add a decoration to an existing child ✔ can add a decoration beyond an existing child ✔ can add multiple decorations remove ✔ can delete a decoration ✔ can delete multiple decorations ✔ ignores decorations that don't exist ✔ compares by both position and type when removing removeOverlap ✔ returns the original array when there is no overlap ✔ splits a partially overlapping decoration ✔ splits a decoration that spans multiple widgets ✔ correctly splits overlapping inline decorations 47 passing (25ms) PS C:\Users\yoophoon\Desktop\prosemirror-view-master> ``` i've checked the test files, the trouble seems caused by `import {tempEditor} from "./view"` for those files with this line log nothing,and i've tried `npm run test -- --server` ```shell PS C:\Users\yoophoon\Desktop\prosemirror-view-master> npm run test -- --server > prosemirror-view@1.33.6 test > pm-runtests --server Test server running on port 53871 ``` ![Image](https://github.com/user-attachments/assets/e3c82eb5-1958-4edc-aec0-5ec7234b9e8c) ![Image](https://github.com/user-attachments/assets/a2218a11-c4d1-466d-ac0a-0e2c952b860a) ![Image](https://github.com/user-attachments/assets/8225a365-7186-4a41-956f-ac2605dd0ef2) i've tried to copy the code in ./test/view.ts into those file taht import the code and those files loged test-information
marijnh commented 2025-02-20 14:20:30 +01:00 (Migrated from github.com)

I get 248 passing, which seems to be all the tests. Did you check the console for errors when you run these in your browser?

I get `248 passing`, which seems to be all the tests. Did you check the console for errors when you run these in your browser?
yoophoon commented 2025-02-20 19:41:37 +01:00 (Migrated from github.com)

I get 248 passing, which seems to be all the tests. Did you check the console for errors when you run these in your browser?

thanks for reply,browser seems can't find view (should be view.js, but the file compiled import this file through import { tempEditor } from "./view"; instead of import { tempEditor } from "./view.js";)

Image

Image
operating system is windows 10

PS C:\Users\yoophoon\Desktop> node -v
v22.14.0
PS C:\Users\yoophoon\Desktop> npm -v
10.9.2
PS C:\Users\yoophoon\Desktop>
> I get `248 passing`, which seems to be all the tests. Did you check the console for errors when you run these in your browser? thanks for reply,browser seems can't find view (should be view.js, but the file compiled import this file through `import { tempEditor } from "./view";` instead of `import { tempEditor } from "./view.js";`) ![Image](https://github.com/user-attachments/assets/18746cb9-2adf-48ff-8c26-02d6e5e24e08) ![Image](https://github.com/user-attachments/assets/9f9cadd7-7fb3-4f66-b2ab-35e24e5e45ad) operating system is windows 10 ```shell PS C:\Users\yoophoon\Desktop> node -v v22.14.0 PS C:\Users\yoophoon\Desktop> npm -v 10.9.2 PS C:\Users\yoophoon\Desktop> ```
marijnh commented 2025-02-21 08:13:19 +01:00 (Migrated from github.com)

For me, moduleserve rewrites that import to...

import { tempEditor } from "/_m/__/view/test/view.js";

... which the browser can handle. So the question is why isn't it doing that for you. Which version of moduleserve does npm ls -a | grep moduleserve show?

For me, moduleserve rewrites that import to... ``` import { tempEditor } from "/_m/__/view/test/view.js"; ``` ... which the browser can handle. So the question is why isn't it doing that for you. Which version of moduleserve does `npm ls -a | grep moduleserve` show?
yoophoon commented 2025-02-22 00:54:09 +01:00 (Migrated from github.com)
yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop
$ git clone https://github.com/ProseMirror/prosemirror-view.git
Cloning into 'prosemirror-view'...
remote: Enumerating objects: 6442, done.
remote: Counting objects: 100% (1839/1839), done.
remote: Compressing objects: 100% (195/195), done.
remote: Total 6442 (delta 1681), reused 1659 (delta 1644), pack-reused 4603 (from 3)
Receiving objects: 100% (6442/6442), 1.83 MiB | 10.18 MiB/s, done.
Resolving deltas: 100% (4599/4599), done.

yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop
$ cd prosemirror-view

yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master)
$ node -v && npm -v
v22.14.0
10.9.2

yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master)
$ npm i
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a g
ood and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported

> prosemirror-view@1.38.0 prepare
> pm-buildhelper src/index.ts


added 261 packages in 13s

30 packages are looking for funding
  run `npm fund` for details

yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master)
$ npm run test

> prosemirror-view@1.38.0 test
> pm-runtests


DevTools listening on ws://127.0.0.1:57021/devtools/browser/09e7753c-f250-46a3-8688-cf64b96cb14f


  Browser tests (chrome)

      DecorationSet
        √ builds up a matching tree
        √ does not build nodes when there are no decorations
        √ puts decorations between children in local
        √ puts decorations spanning children in local
        √ puts node decorations in the parent node
        √ drops empty inline decorations
        find
          √ finds all when no arguments are given
          √ finds only those within the given range
          √ finds decorations at the edge of the range
          √ returns the correct offset for deeply nested decorations
          √ can filter by predicate
        map
          √ supports basic mapping
          √ drops deleted decorations
          √ can map node decorations
          √ can map inside node decorations
          √ removes partially overwritten node decorations
          √ removes exactly overwritten node decorations
          √ isn't inclusive by default
          √ understands unclusiveLeft
          √ understands unclusiveRight
          √ preserves subtrees not touched by mapping
          √ rebuilds when a node is joined
          √ rebuilds when a node is split
          √ correctly rebuilds a deep structure
          √ calls onRemove when dropping decorations
          √ respects the side option on widgets
          √ doesn't doubly map decorations nested in multiple nodes
          √ rebuilds subtrees correctly at an offset
          √ properly maps decorations after deleted siblings
          √ can map the content of nodes that moved in the same transaction
          √ can handle nodes moving up multiple levels
          √ maps inline decorations through ranges with > 3 elements
          √ correctly offsets a deep structure
          √ doesn't get confused by composite changes
        add
          √ can add a local decoration
          √ can add a decoration in a new child
          √ can add a decoration to an existing child
          √ can add a decoration beyond an existing child
          √ can add multiple decorations
        remove
          √ can delete a decoration
          √ can delete multiple decorations
          √ ignores decorations that don't exist
          √ compares by both position and type when removing
      removeOverlap
        √ returns the original array when there is no overlap
        √ splits a partially overlapping decoration
        √ splits a decoration that spans multiple widgets
        √ correctly splits overlapping inline decorations


  47 passing (21ms)


yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master)
$ npm ls -a | grep moduleserve
│   ├─┬ esmoduleserve@0.2.1

yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master)
$

the moduleserve version is 0.2.1

i've tried those commands on another computer and the result is the same that only webtest-decoration.js works

```shell yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop $ git clone https://github.com/ProseMirror/prosemirror-view.git Cloning into 'prosemirror-view'... remote: Enumerating objects: 6442, done. remote: Counting objects: 100% (1839/1839), done. remote: Compressing objects: 100% (195/195), done. remote: Total 6442 (delta 1681), reused 1659 (delta 1644), pack-reused 4603 (from 3) Receiving objects: 100% (6442/6442), 1.83 MiB | 10.18 MiB/s, done. Resolving deltas: 100% (4599/4599), done. yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop $ cd prosemirror-view yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master) $ node -v && npm -v v22.14.0 10.9.2 yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master) $ npm i npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a g ood and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported > prosemirror-view@1.38.0 prepare > pm-buildhelper src/index.ts added 261 packages in 13s 30 packages are looking for funding run `npm fund` for details yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master) $ npm run test > prosemirror-view@1.38.0 test > pm-runtests DevTools listening on ws://127.0.0.1:57021/devtools/browser/09e7753c-f250-46a3-8688-cf64b96cb14f Browser tests (chrome) DecorationSet √ builds up a matching tree √ does not build nodes when there are no decorations √ puts decorations between children in local √ puts decorations spanning children in local √ puts node decorations in the parent node √ drops empty inline decorations find √ finds all when no arguments are given √ finds only those within the given range √ finds decorations at the edge of the range √ returns the correct offset for deeply nested decorations √ can filter by predicate map √ supports basic mapping √ drops deleted decorations √ can map node decorations √ can map inside node decorations √ removes partially overwritten node decorations √ removes exactly overwritten node decorations √ isn't inclusive by default √ understands unclusiveLeft √ understands unclusiveRight √ preserves subtrees not touched by mapping √ rebuilds when a node is joined √ rebuilds when a node is split √ correctly rebuilds a deep structure √ calls onRemove when dropping decorations √ respects the side option on widgets √ doesn't doubly map decorations nested in multiple nodes √ rebuilds subtrees correctly at an offset √ properly maps decorations after deleted siblings √ can map the content of nodes that moved in the same transaction √ can handle nodes moving up multiple levels √ maps inline decorations through ranges with > 3 elements √ correctly offsets a deep structure √ doesn't get confused by composite changes add √ can add a local decoration √ can add a decoration in a new child √ can add a decoration to an existing child √ can add a decoration beyond an existing child √ can add multiple decorations remove √ can delete a decoration √ can delete multiple decorations √ ignores decorations that don't exist √ compares by both position and type when removing removeOverlap √ returns the original array when there is no overlap √ splits a partially overlapping decoration √ splits a decoration that spans multiple widgets √ correctly splits overlapping inline decorations 47 passing (21ms) yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master) $ npm ls -a | grep moduleserve │ ├─┬ esmoduleserve@0.2.1 yoophoon@DESKTOP-Q1K9BAQ MINGW64 ~/Desktop/prosemirror-view (master) $ ``` the moduleserve version is 0.2.1 i've tried those commands on another computer and the result is the same that only webtest-decoration.js works
marijnh commented 2025-02-23 19:46:25 +01:00 (Migrated from github.com)

Weird. Even on a fresh clone, with that node version, I'm not getting this issue. Possibly it's a bug in the resolve package that only shows up on Windows. Attached patch adds an extension to those imports, which is good style anyway, and should fix the problem.

Weird. Even on a fresh clone, with that node version, I'm not getting this issue. Possibly it's a bug in the `resolve` package that only shows up on Windows. Attached patch adds an extension to those imports, which is good style anyway, and should fix the problem.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/buildhelper#3
No description provided.