Node version 20.11.0
Windows 10
dev branch
Some tests from multiple packages failed. The following is a sample from running test on package/lib
:
FAIL services/rest/routes/events.test.js (136.299 s)
● routes/events › should limit the number of response items
thrown: "Exceeded timeout of 90000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
57 | });
58 |
> 59 | it('should limit the number of response items', async () => {
| ^
60 | const promises = [];
61 | for (let i = 0; i < 101; i++) {
62 | promises.push(Note.save({ title: 'toto' }));
at it (services/rest/routes/events.test.ts:59:2)
at Object.describe (services/rest/routes/events.test.ts:10:1)
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
Summary of all failing tests
FAIL services/RevisionService.test.js (193.728 s)
● services/RevisionService › should not create a revision if there is already a recent one
expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
470 | await Note.save({ id: n1_v0.id, title: 'hello 3' });
471 | await revisionService().collectRevisions(); // No rev because time since last rev is less than the required 'interval between revisions'
> 472 | expect(Date.now() - interval < timeRev2).toBe(true); // check the computer is not too slow for this test
| ^
473 | expect((await Revision.all()).length).toBe(2);
474 | }));
475 |
at toBe (services/RevisionService.test.ts:472:44)
at fulfilled (services/RevisionService.test.js:12:24)
FAIL services/rest/Api.test.js (256.942 s)
● services_rest_Api › should create notes with pdf embeds
expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
518 |
519 | const resource = resources[0];
> 520 | expect(response.body.indexOf(resource.id) >= 0).toBe(true);
| ^
521 | }));
522 |
523 | it('should handle tokens', (async () => {
at toBe (services/rest/Api.test.ts:520:51)
at fulfilled (services/rest/Api.test.js:12:24)
FAIL ./import-enex-md-gen.test.js (117.903 s)
● import-enex-md-gen › should convert ENEX content to Markdown
expect(received).toBe(expected) // Object.is equality
Expected: true
Received: false
67 | console.info(result.join('\n'));
68 |
> 69 | expect(false).toBe(true);
| ^
70 | // return;
71 | } else {
72 | expect(true).toBe(true);
at toBe (import-enex-md-gen.test.ts:69:19)
at fulfilled (import-enex-md-gen.test.js:12:24)
● import-enex-md-gen › should handle tasks
expect(received).toEqual(expected) // deep equality
- Expected - 11
+ Received + 11
- a
-
- b
-
+ a
+
+ b
+
- List 1
-
+ List 1
+
- - [x] Clara
+ - [x] Clara
- - [ ] Bob
-
+ - [ ] Bob
+
- List 2
-
+ List 2
+
- [ ] Jeff
119 | const expectedMd = await shim.fsDriver().readFile(`${enexSampleBaseDir}/tasks.md`);
120 | const note: NoteEntity = (await Note.all())[0];
> 121 | expect(note.body).toEqual(expectedMd);
| ^
122 | });
123 |
124 | it('should handle empty note content', async () => {
at toEqual (import-enex-md-gen.test.ts:121:21)
at fulfilled (import-enex-md-gen.test.js:12:24)
● import-enex-md-gen › should import images with sizes
expect(received).toBe(expected) // Object.is equality
- Expected - 16
+ Received + 16
- ![](:/52de02640b588b40dcb0a920b9e089bb)
-
+ ![](:/52de02640b588b40dcb0a920b9e089bb)
+
- #### Last Transfer
-
+ #### Last Transfer
+
- <img src=":/b3d82d4e0af0fe302ee3e2339edfe13d" width="65" height="65" alt="bank.svg"/>
-
+ <img src=":/b3d82d4e0af0fe302ee3e2339edfe13d" width="65" height="65" alt="bank.svg"/>
+
- ##### **Next Day Bank Deposit / USD**
-
+ ##### **Next Day Bank Deposit / USD**
+
- ###### **March 5, 2023 04:28AM**
-
+ ###### **March 5, 2023 04:28AM**
+
- * * *
-
+ * * *
+
- Processing
+ Processing
- **Confirmation**: ILbwHO5Z06p7meW
-
+ **Confirmation**: ILbwHO5Z06p7meW
+
- ![](https://joplinapp.org/images/logo-text.svg)
+ ![](https://joplinapp.org/images/logo-text.svg)
<img src="https://joplinapp.org/images/logo-text.svg" width="100" height="50"/>
186 | expected = expected.replace(/RESOURCE_ID_2/, svgResource.id);
187 |
> 188 | expect(note.body).toBe(expected);
| ^
189 | const filePath = `${enexSampleBaseDir}/invalid_html.enex`;
190 | await expectThrow(async () => importEnex('', filePath));
191 | });
at toBe (import-enex-md-gen.test.ts:188:21)
at fulfilled (import-enex-md-gen.test.js:12:24)
FAIL services/interop/InteropService_Importer_Md_frontmatter.test.js (146.477 s)
● InteropService_Importer_Md_frontmatter: importMetadata › should import file and set all metadata correctly
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- This is the note body
+ This is the note body
↵
47 | expect(note.todo_completed).toBe(0);
48 | expect(time.formatMsToLocal(note.todo_due, format)).toBe('22/08/2021 00:00');
> 49 | expect(note.body).toBe('This is the note body\n');
| ^
50 |
51 | const tags = await Tag.tagsByNoteId(note.id);
52 | expect(tags.length).toBe(3);
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:49:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should only import data from the first yaml block
expect(received).toBe(expected) // Object.is equality
- Expected - 5
+ Received + 5
- ---
+ ---
- author: xxx
+ author: xxx
- ---
-
+ ---
+
- note body
+ note body
↵
62 | expect(note.title).toBe('xxx');
63 | expect(note.author).not.toBe('xxx');
> 64 | expect(note.body).toBe('---\nauthor: xxx\n---\n\nnote body\n');
| ^
65 | });
66 | it('should only import, duplicate notes and tags are not created', async () => {
67 | const note = await importTestFile('duplicates.md');
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:64:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should not import items as numbers
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- note body
+ note body
↵
78 |
79 | expect(note.title).toBe('001');
> 80 | expect(note.body).toBe('note body\n');
| ^
81 | });
82 | it('should normalize whitespace and load correctly', async () => {
83 | const note = await importTestFile('normalize.md');
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:80:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should normalize whitespace and load correctly
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- note body
+ note body
↵
84 |
85 | expect(note.title).toBe('norm');
> 86 | expect(note.body).toBe('note body\n');
| ^
87 |
88 | const tags = await Tag.tagsByNoteId(note.id);
89 | expect(tags.length).toBe(3);
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:86:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should load unquoted special forms correctly
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- note body
+ note body
↵
93 |
94 | expect(note.title).toBe('Unquoted');
> 95 | expect(note.body).toBe('note body\n');
| ^
96 |
97 | expect(note.longitude).toBe('-94.51350100');
98 | expect(note.is_todo).toBe(1);
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:95:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should accept file with no newline after the block marker
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- note body
+ note body
↵
157 | it('should accept file with no newline after the block marker', async () => {
158 | const note = await importTestFile('no_newline_after_marker.md');
> 159 | expect(note.body).toBe('note body\n');
| ^
160 | });
161 |
162 | it('should handle multiple newlines before the note body', async () => {
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:159:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should handle multiple newlines before the note body
expect(received).toBe(expected) // Object.is equality
- Expected - 2
+ Received + 2
-
-
+
+
note body
162 | it('should handle multiple newlines before the note body', async () => {
163 | const note = await importTestFile('multiple_newlines_after_marker.md');
> 164 | expect(note.body).toBe('\n\nnote body');
| ^
165 | });
166 |
167 | it('should accept note with a title that starts with a dash', async () => {
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:164:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
● InteropService_Importer_Md_frontmatter: importMetadata › should recognize frontmatter in a file that starts with a UTF8 byte order mark
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 1
- This note begins with an invisible byte order mark, just before its frontmatter.
+ This note begins with an invisible byte order mark, just before its frontmatter.
↵
180 | const note = await importTestFile('note_with_byte_order_mark.md');
181 | expect(note.title).toBe('Frontmatter test');
> 182 | expect(note.body).toBe('This note begins with an invisible byte order mark, just before its frontmatter.\n');
| ^
183 |
184 | const tags = (await Tag.tagsByNoteId(note.id)).map(tag => tag.title).sort();
185 | expect(tags).toMatchObject(['tag1', 'tag2']);
at toBe (services/interop/InteropService_Importer_Md_frontmatter.test.ts:182:21)
at fulfilled (services/interop/InteropService_Importer_Md_frontmatter.test.js:12:24)
FAIL services/synchronizer/synchronizer_MigrationHandler.test.js (228.705 s)
● MigrationHandler › should apply migration 3 normal
expect(received).toBe(expected) // Object.is equality
Expected: ""
Received: "Cannot load folder: folder1"
761 | if (thrownError) {
762 | console.error(thrownError);
> 763 | expect(thrownError.message).toBe('');
| ^
764 | } else {
765 | expect(true).toBe(true);
766 | }
at toBe (testing/test-utils.ts:763:31)
at Generator.throw (<anonymous>)
at rejected (testing/test-utils.js:19:32)
FAIL ./import-enex-html-gen.test.js (45.115 s)
● EnexToHtml › should convert from Enex to Html: checkbox-list
expect(received).toEqual(expected) // deep equality
- Expected - 15
+ Received + 15
- <en-note>
+ <en-note>
- <div>
+ <div>
- <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
+ <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
- <ul>
+ <ul>
- <li>
+ <li>
- <div><input checked="checked" type="checkbox" onclick="return false;">Foo</div>
+ <div><input checked="checked" type="checkbox" onclick="return false;">Foo</div>
- </li>
+ </li>
- <li>
+ <li>
- <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
+ <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
- </li>
+ </li>
- <li>
+ <li>
- <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
+ <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
- </li>
+ </li>
- </ul>
+ </ul>
- </div>
+ </div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: checklist
expect(received).toEqual(expected) // deep equality
- Expected - 18
+ Received + 18
- <en-note>
+ <en-note>
- <div>
+ <div>
- <p>In Evernote a checklist is not the same as a list with checkboxes.</p>
+ <p>In Evernote a checklist is not the same as a list with checkboxes.</p>
- <ul style="--en-todo:true;">
+ <ul style="--en-todo:true;">
- <li style="--en-checked:false;">
+ <li style="--en-checked:false;">
- <input type="checkbox" onclick="return false;">
+ <input type="checkbox" onclick="return false;">
- <div>One</div>
+ <div>One</div>
- </li>
+ </li>
- <li style="--en-checked:true;">
+ <li style="--en-checked:true;">
- <input checked="checked" type="checkbox" onclick="return false;">
+ <input checked="checked" type="checkbox" onclick="return false;">
- <div>Two</div>
+ <div>Two</div>
- </li>
+ </li>
- <li style="--en-checked:false;">
+ <li style="--en-checked:false;">
- <input type="checkbox" onclick="return false;">
+ <input type="checkbox" onclick="return false;">
- <div>Three</div>
+ <div>Three</div>
- </li>
+ </li>
- </ul>
+ </ul>
- </div>
+ </div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: svg
expect(received).toEqual(expected) // deep equality
- Expected - 2
+ Received + 2
- <en-note>
+ <en-note>
- <div><img style="margin:0px;padding:0px;outline:0px;width:74px;height:36px;position:absolute;bottom:-5px;left:0px;transform:translate(0px, 100%);stroke-dasharray:90;transition:stroke-dashoffset 0.5s cubic-bezier(0.97, 0.16, 0.62, 0.76) 0s;stroke-dashoffset:0;" src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' data-evernote-id='97' class='js-evernote-checked'%3e%3cuse xlink:href='https://wordminds.com/wp-content/themes/wordminds/assets/img/hint_left.svg%23hint_left' data-evernote-id='98' class='js-evernote-checked'%3e%3c/us %3c/svg%3e"></div>
+ <div><img style="margin:0px;padding:0px;outline:0px;width:74px;height:36px;position:absolute;bottom:-5px;left:0px;transform:translate(0px, 100%);stroke-dasharray:90;transition:stroke-dashoffset 0.5s cubic-bezier(0.97, 0.16, 0.62, 0.76) 0s;stroke-dashoffset:0;" src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' data-evernote-id='97' class='js-evernote-checked'%3e%3cuse xlink:href='https://wordminds.com/wp-content/themes/wordminds/assets/img/hint_left.svg%23hint_left' data-evernote-id='98' class='js-evernote-checked'%3e%3c/use%3e%3c/svg%3e"></div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: en-media--image
expect(received).toEqual(expected) // deep equality
- Expected - 11
+ Received + 11
- <en-note>
+ <en-note>
- <div><input type="checkbox" onclick="return false;">This is a test</div>
+ <div><input type="checkbox" onclick="return false;">This is a test</div>
- <div><input type="checkbox" onclick="return false;">A test for <span style="font-weight: bold;">bold</span></div>
+ <div><input type="checkbox" onclick="return false;">A test for <span style="font-weight: bold;">bold</span></div>
- <div>
+ <div>
- <input type="checkbox" onclick="return false;">A test for <i>italic</i>
+ <input type="checkbox" onclick="return false;">A test for <i>italic</i>
- <br>
+ <br>
- </div>
+ </div>
- <div>
+ <div>
- <br>
+ <br>
- </div>
+ </div>
- <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>
+ <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: en-media--audio
expect(received).toEqual(expected) // deep equality
- Expected - 11
+ Received + 11
- <en-note>
+ <en-note>
- <div>
+ <div>
- <audio controls="" preload="none" style="width:480px;">
+ <audio controls="" preload="none" style="width:480px;">
- <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
+ <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
- <p>Your browser does not support HTML5 audio.</p>
+ <p>Your browser does not support HTML5 audio.</p>
- </audio>
+ </audio>
- <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
+ <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
- </div>
+ </div>
- <div>
+ <div>
- <br>
+ <br>
- </div>
+ </div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: attachment
expect(received).toEqual(expected) // deep equality
- Expected - 5
+ Received + 5
- <en-note>
+ <en-note>
- <div><a href=":/21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:poi ;" alt="attachment-1">attachment-1</a></div>
+ <div><a href=":/21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
- <div>
+ <div>
- <br>
+ <br>
- </div>
+ </div>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
● EnexToHtml › should convert from Enex to Html: quoted-attributes
expect(received).toEqual(expected) // deep equality
- Expected - 2
+ Received + 2
- <en-note>
+ <en-note>
- <h1 style="box-sizing:inherit;font-family:"Guardian TextSans Web", "Helvetica Neue", Helvetica, Arial, sans-serif;margin-top:0.2em;margin-bottom:0.35em;font-size:2.125em;font-weight:600;line-height:1.3;">Association Between mRNA Vaccination and COV 9 Hospitalization and Disease Severity</h1>
+ <h1 style="box-sizing:inherit;font-family:"Guardian TextSans Web", "Helvetica Neue", Helvetica, Arial, sans-serif;margin-top:0.2em;margin-bottom:0.35em;font-size:2.125em;font-weight:600;line-height:1.3;">Association Between mRNA Vaccination and COVID-19 Hospitalization and Disease Severity</h1>
</en-note>
53 | const expectedOutput = await shim.fsDriver().readFile(outputFile);
54 | const actualOutput = await beautifyHtml(await enexXmlToHtml(enexInput, options.resources));
> 55 | expect(actualOutput).toEqual(expectedOutput);
| ^
56 | }));
57 | };
58 |
at Object.toEqual (import-enex-html-gen.test.js:55:24)
FAIL ./fsDriver.test.js
● fsDriver › should resolveRelativePathWithinDir
expect(received).toBe(expected) // Object.is equality
Expected: "c:\\test\\temp\\my\\file.txt"
Received: "k:\\test\\temp\\my\\file.txt"
17 | it('should resolveRelativePathWithinDir', async () => {
18 | const fsDriver = new FsDriverNode();
> 19 | expect(fsDriver.resolveRelativePathWithinDir('/test/temp', './my/file.txt').toLowerCase()).toBe(platformPath('/test/temp/my/file.txt'));
| ^
20 | expect(fsDriver.resolveRelativePathWithinDir('/', './test').toLowerCase()).toBe(platformPath('/test'));
21 | expect(fsDriver.resolveRelativePathWithinDir('/test', 'myfile.txt').toLowerCase()).toBe(platformPath('/test/myfile.txt'));
22 | expect(fsDriver.resolveRelativePathWithinDir('/test/temp', './mydir/../test.txt').toLowerCase()).toBe(platformPath('/test/temp/test.txt'));
at toBe (fsDriver.test.ts:19:94)
at fsDriver.test.js:27:67
at Object.<anonymous>.__awaiter (fsDriver.test.js:9:10)
at Object.__awaiter (fsDriver.test.ts:17:55)
FAIL services/rest/routes/events.test.js (136.299 s)
● routes/events › should limit the number of response items
thrown: "Exceeded timeout of 90000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
57 | });
> 59 | it('should limit the number of response items', async () => {
| ^
60 | const promises = [];
61 | for (let i = 0; i < 101; i++) {
62 | promises.push(Note.save({ title: 'toto' }));
at it (services/rest/routes/events.test.ts:59:2)
at Object.describe (services/rest/routes/events.test.ts:10:1)
Test Suites: 8 failed, 83 passed, 91 total
Tests: 23 failed, 764 passed, 787 total
Snapshots: 0 total
Time: 1030.317 s