<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 20 Dec 2020 at 21:32, Abraham Raji <<a href="mailto:abrahamrajione@gmail.com">abrahamrajione@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Hey Everyone,<div dir="auto"><br></div><div dir="auto">I've made all the changes suggested by the team in the previous mails except enabling tests. I ran the tests with the dependencies from npm registry and they ran just fine. So it should be a dependency issue. Is it possible to upload the package without the tests for now?</div><div dir="auto"><br></div><div dir="auto"><a href="https://salsa.debian.org/avron/node-prosemirror-commands/" rel="noreferrer" target="_blank">https://salsa.debian.org/avron/node-prosemirror-commands/</a><br></div></div></div></blockquote><div><br></div><div>I tried enabling tests but it seems to need HUGE amounts of heap memory somehow, and due to insufficient RAM at my end, it crashes :/</div><div>If you have some resources, maybe you could give it a try? (Patch below) I wonder if there is a memory leak somewhere, since the tests seemingly do not looks so intensive.<br></div><div><br></div><div>diff --git a/debian/control b/debian/control<br>index af2ee7b..8b8b322 100644<br>--- a/debian/control<br>+++ b/debian/control<br>@@ -12,6 +12,8 @@ Build-Depends:<br>  , node-rollup-plugin-buble<br>  , node-prosemirror-transform (>= 1.0.0)<br>  , node-prosemirror-state (>= 1.0.0)<br>+ , node-mocha<br>+ , node-prosemirror-test-builder<br> Standards-Version: 4.5.1<br> Homepage: <a href="https://github.com/prosemirror/prosemirror-commands#readme">https://github.com/prosemirror/prosemirror-commands#readme</a><br> Vcs-Git: <a href="https://salsa.debian.org/js-team/node-prosemirror-commands.git">https://salsa.debian.org/js-team/node-prosemirror-commands.git</a><br>diff --git a/debian/patches/0002-do-not-use-ist.patch b/debian/patches/0002-do-not-use-ist.patch<br>new file mode 100644<br>index 0000000..024c7ec<br>--- /dev/null<br>+++ b/debian/patches/0002-do-not-use-ist.patch<br>@@ -0,0 +1,39 @@<br>+--- a/test/test-commands.js<br>++++ b/test/test-commands.js<br>+@@ -1,7 +1,7 @@<br>+ const {Schema} = require("prosemirror-model")<br>+ const {EditorState, Selection, TextSelection, NodeSelection} = require("prosemirror-state")<br>+ const {schema, eq, doc, blockquote, pre, h1, p, li, ol, ul, em, strong, hr, img} = require("prosemirror-test-builder")<br>+-const ist = require("ist")<br>++const assert = require('assert')<br>+ <br>+ const {joinBackward, selectNodeBackward, joinForward, selectNodeForward, deleteSelection, joinUp, joinDown, lift,<br>+        wrapIn, splitBlock, splitBlockKeepMarks, liftEmptyBlock, createParagraphNear, setBlockType,<br>+@@ -24,8 +24,8 @@<br>+ function apply(doc, command, result) {<br>+   let state = mkState(doc)<br>+   command(state, tr => state = state.apply(tr))<br>+-  ist(state.doc, result || doc, eq)<br>+-  if (result && result.tag.a != null) ist(state.selection,  selFor(result), eq)<br>++  assert.equal(state.doc, result || doc)<br>++  if (result && result.tag.a != null) assert.equal(state.selection,  selFor(result))<br>+ }<br>+ <br>+ describe("joinBackward", () => {<br>+@@ -339,14 +339,14 @@<br>+   it("keeps marks when used after marked text", () => {<br>+     let state = mkState(doc(p(strong("foo<a>"), "bar")))<br>+     splitBlockKeepMarks(state, tr => state = state.apply(tr))<br>+-    ist(state.storedMarks.length, 1)<br>++    assert.equal(state.storedMarks.length, 1)<br>+   })<br>+ <br>+   it("preserves the stored marks", () => {<br>+     let state = mkState(doc(p(em("foo<a>"))))<br>+     toggleMark(schema.marks.strong)(state, tr => state = state.apply(tr))<br>+     splitBlockKeepMarks(state, tr => state = state.apply(tr))<br>+-    ist(state.storedMarks.length, 2)<br>++    assert.equal(state.storedMarks.length, 2)<br>+   })<br>+ })<br>+ <br>diff --git a/debian/patches/series b/debian/patches/series<br>index 7f0ff15..7f1e189 100644<br>--- a/debian/patches/series<br>+++ b/debian/patches/series<br>@@ -1 +1,2 @@<br> 001_rollup-plugin-buble.patch<br>+0002-do-not-use-ist.patch<br>diff --git a/debian/tests/pkg-js/test b/debian/tests/pkg-js/test<br>new file mode 100644<br>index 0000000..dd9f788<br>--- /dev/null<br>+++ b/debian/tests/pkg-js/test<br>@@ -0,0 +1,2 @@<br>+export NODE_OPTIONS=--max_old_space_size=6000<br>+mocha -R spec test/test-*.js<br></div></div></div>