How to run build test for Electron Client?

OS: Windows 10
Joplin 1.0.194 (dev, win32)

Sync Version: 1
Profile Version: 28

Revision: d606e021 (master)

I’m working on fixing GH issue: Support automatic dark/light theme switching according to OS settings and I have made changes in below files:

  • ReactNativeClient > lib > models > Setting.js
  • ReactNativeClient > lib > reducer.js
  • ElectronClient > gui > ConfigScreen.jsx
  • ElectronClient > app.js

Last time I submitted PR for this issue,as per discussion with @laurent there was some issues with the code and build test was missing so this time I’ve fixed those issues but now before PR I have to run build test and for that I followed steps as mentioned in CONTRIBUTING.md

So I ran this command in CliClient directory npm test and here is the output of terminal:

R:\Dev\joplin-kowalskidev\CliClient>npm run test

> joplin@1.0.161 test R:\Dev\joplin-kowalskidev\CliClient
> gulp buildTests -L && jasmine --config=tests/support/jasmine.json

Testing with sync target: memory
Randomized with seed 50885
Started
.1
................................................................................................F......F......F...............................................................
Error converting file: list.html
--------------------------------- Got:
[
  'Liste de courses',
  '',
  '- [X] Pizzas',
  '',
  '- [X] Pain',
  '',
  '- [X] Jambon',
  '',
  '- [X] On its own',
  '',
  'End'
]
--------------------------------- Expected:
[
  'Liste de courses',
  '',
  '- [X] Pizzas',
  '- [X] Pain',
  '- [X] Jambon',
  '',
  '- [X] On its own',
  '',
  'End'
]
--------------------------------------------

F...1
.1
.....................F.FFFF...............................................

Failures:
1) services_Revision should delete old revisions (2 notes, 2 rev)
  Message:
    Expected 0 to be 1.
  Stack:
    Error: Expected 0 to be 1.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\services_Revision.js:133:29
        at <Jasmine>
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

2) services_Revision should not delete old revisions if one of them is still encrypted (3)
  Message:
    Expected 0 to be 1.
  Stack:
    Error: Expected 0 to be 1.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\services_Revision.js:371:41
        at <Jasmine>
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

3) services_Revision should delete old revisions (1 note, 2 rev)
  Message:
    Expected 0 to be 1.
  Stack:
    Error: Expected 0 to be 1.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\services_Revision.js:73:28
        at <Jasmine>
        at processTicksAndRejections (internal/process/task_queues.js:97:5)

4) EnexToMd should convert from Enex to Markdown
  Message:
    Expected false to be true.
  Stack:
    Error: Expected false to be true.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToMd.js:62:19
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

5) EnexToHtml should convert from Enex to Html: svg
  Message:
    Expected '<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/use%3e%3c/svg%3e"></div>
    </en-note>' to equal '<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/use%3e%3c/svg%3e"></div>
    </en-note>'.
  Stack:
    Error: Expected '<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/use%3e%3c/svg%3e"></div>
    </en-note>' to equal '<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/use%3e%3c/svg%3e"></div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

6) EnexToHtml should convert from Enex to Html: checklist-list
  Message:
    Expected '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

7) EnexToHtml should convert from Enex to Html: attachment
  Message:
    Expected '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

8) EnexToHtml should convert from Enex to Html: en-media--audio
  Message:
    Expected '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

9) EnexToHtml should convert from Enex to Html: en-media--image
  Message:
    Expected '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>' to equal '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>' to equal '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:373:4)

254 specs, 9 failures
Finished in 558.027 seconds
Randomized with seed 50885 (jasmine --random=true --seed=50885)

And I also tried running npm run test command in ElectronClient and ReactNativeClient directories but it throws an error: 'Error: no test specified'.

Please help me how to run tests when we make changes in libraries and views. I’m totally new to open source and learning a lot as getting familiarizes with Joplin

I don’t understand why the ENEX tests would fail has they haven’t changed in a while, and also I don’t see the difference between expected and actual result. Maybe you have some newline issue or something. I’d delete the repo, clone again and try again.

1 Like

Okay Sir, I’ll try.

I didn’t changed anything under CliClient so maybe the issue is in the GitHub repo.

I deleted my repo, cloned again and build the app now without changing anything everything was untouched. I ran npm test command in CliClient directory still got 6 failures…
Here is the terminal log:

R:\Dev\joplin-kowalskidev\CliClient>npm test

> joplin@1.0.162 test R:\Dev\joplin-kowalskidev\CliClient
> gulp buildTests -L && jasmine --config=tests/support/jasmine.json

Testing with sync target: memory
Randomized with seed 11048
Started
............................................................................................................................................................................................................................................
Error converting file: list.html
--------------------------------- Got:
[
  'Liste de courses',
  '',
  '- [X] Pizzas',
  '',
  '- [X] Pain',
  '',
  '- [X] Jambon',
  '',
  '- [X] On its own',
  '',
  'End'
]
--------------------------------- Expected:
[
  'Liste de courses',
  '',
  '- [X] Pizzas',
  '- [X] Pain',
  '- [X] Jambon',
  '',
  '- [X] On its own',
  '',
  'End'
]
--------------------------------------------

F....F.FFFF.........................

Failures:
1) EnexToMd should convert from Enex to Markdown
  Message:
    Expected false to be true.
  Stack:
    Error: Expected false to be true.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToMd.js:62:19
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

2) EnexToHtml should convert from Enex to Html: attachment
  Message:
    Expected '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div><a href="joplin://21ca2b948f222a38802940ec7e2e5de3" hash="21ca2b948f222a38802940ec7e2e5de3" type="application/pdf" style="cursor:pointer;" alt="attachment-1">attachment-1</a></div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

3) EnexToHtml should convert from Enex to Html: en-media--image
  Message:
    Expected '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>' to equal '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>' to equal '<en-note>
      <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 <i>italic</i>
        <br>
        <br>
      </div>
      <div>
        <br>
        <br>
      </div>
      <div><i><img src=":/89ce7da62c6b2832929a6964237e98e9" hash="89ce7da62c6b2832929a6964237e98e9" type="image/jpeg" alt=""></i></div>      
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

4) EnexToHtml should convert from Enex to Html: en-media--audio
  Message:
    Expected '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <audio controls="" preload="none" style="width:480px;">
          <source src=":/9168ee833d03c5ea7c730ac6673978c1" type="audio/mp4">
          <p>Your browser does not support HTML5 audio.</p>
        </audio>
        <p><a href=":/9168ee833d03c5ea7c730ac6673978c1">audio test</a></p>
      </div>
      <div>
        <br>
        <br>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

5) EnexToHtml should convert from Enex to Html: checklist-list
  Message:
    Expected '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>'.
  Stack:
    Error: Expected '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>' to equal '<en-note>
      <div>
        <p>For example, consider an exported Evernote list with todo checkboxes like this:</p>
        <ul>
          <li>
            <div><input type="checkbox" onclick="return false;">Foo</div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><b>Bar</b></div>
          </li>
          <li>
            <div><input type="checkbox" onclick="return false;"><i>Baz</i></div>
          </li>
        </ul>
      </div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

6) EnexToHtml should convert from Enex to Html: svg
  Message:
    Expected '<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/use%3e%3c/svg%3e"></div>
    </en-note>' to equal '<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/use%3e%3c/svg%3e"></div>
    </en-note>'.
  Stack:
    Error: Expected '<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/use%3e%3c/svg%3e"></div>
    </en-note>' to equal '<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/use%3e%3c/svg%3e"></div>
    </en-note>'.
        at <Jasmine>
        at R:\Dev\joplin-kowalskidev\CliClient\tests-build\EnexToHtml.js:45:24
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async UserContext.<anonymous> (R:\Dev\joplin-kowalskidev\CliClient\tests-build\test-utils.js:375:4)

272 specs, 6 failures
Finished in 392.724 seconds
Randomized with seed 11048 (jasmine --random=true --seed=11048)
npm ERR! Test failed.  See above for more details.

I’m still confused what should be the expected output?

This are the files I’ve changed in my old repo and how am I supposed to run tests for the above changes in order to submit PR?

Is it like: npm test -- --filter='setting' ?

@laurent Please help me with the build tests, I have spent lot of time in fixing this issue and just build test is remaining to submit PR on GH

No, the argument to the filter option is the test file you want to run, not the feature you want to test.

As for the errors, are you sure you are pulling from the right repository? Because unless I am mistaken, the files you changed should not trigger the errors and I am not getting them either in my repo, which is level with the master branch as I write.

Well that surprised me also.

I have pulled from here: https://github.com/laurent22/joplin
this is the correct repo. Right?

I recommend trying the following things:

git remote add upstream https://github.com/laurent22/joplin
git fetch upstream
git merge upstream/master master

And then run the tests

I tried that commands and here is my terminal log:

R:\Dev\joplin-kowalskidev>git remote add upstream https://github.com/laurent22/joplin
fatal: remote upstream already exists.

R:\Dev\joplin-kowalskidev>git fetch upstream

R:\Dev\joplin-kowalskidev>git merge upstream/master master
Already up to date.

So what should I do now?

So the only conclusion we have is that the errors are being triggered due to the modifications you have made in the code. I guess you will have to figure out how the Enex code is being affected by your code changes. I have not really studied that part of the code.

Yea...I think I have to look into that Enex code...
Btw..thanks for your help! I appreciate it :slightly_smiling_face:

No problem. :grinning:

1 Like

Could it be some issue with git that would convert the Linux newlines to Windows ones? As far as I can tell all tests are passing on master.

Hmm, I need to look into this.
I don’t know about the git command line, but git-bash which is what is mostly used in Windows has some options to set that

I tried running npm start in ClieClient directory and it throws this error:

> Executing task in folder Joplin: npm run start <


> joplin@1.0.161 start R:\Dev\joplin-kowalskidev\CliClient
> gulp build -L && node 'build/main.js' --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev

internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'R:\Dev\joplin-kowalskidev\CliClient\'build\main.js''        
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)        
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! joplin@1.0.161 start: `gulp build -L && node 'build/main.js' --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the joplin@1.0.161 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Zaid Kesarani\AppData\Roaming\npm-cache\_logs\2020-04-04T05_47_38_150Z-debug.log
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

So is it possible that build tests are failing because Cli client isn’t working in my system?

This is a more catastrophic failure. Apparently it cannot find the main.js file at all!
I don’t know if any of the developers actually use Windows for development. It seems to be a Windows specific problem.
Since you already have Linux you can give it a try there.

Okay....Finally I have to leave windows :sweat_smile:

It should work on Windows, as that’s what I often use.

I think you have a least a problem with your global git autocrlf config, which should be off, but maybe you have it set to “windows”.

So I should set autocrlf to false like this: git config --global core.autocrlf false
right?

Actually I’m less experienced in using git and I even confused how git config can affects the working of code.

Do we have problems in line endings? Here is the article related to this: https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings

That would probably explain why some of the tests are failing. However I still don’t understand where is the error in the npm start in cli client. Apparently the path-utils.js is not working properly. Or maybe there is an alternative explanation…

1 Like