Setup Mockoon for testing
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3465407. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !38
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>@mjb3141 has setup a first config for Mockoon. We need to be able to run that as part of the Gitlab config for the phpunit job.</p>
<p>Here is documentation on how to run something before the script:<br>
<a href="https://project.pages.drupalcode.org/gitlab_templates/info/customizations/">https://project.pages.drupalcode.org/gitlab_templates/info/customizations/</a></p>
<p>Here is doucmentation on how to setup Mockoon together with a config:<br>
<a href="https://blog-bertrand-thomas.devpro.fr/2022/03/09/mock-rest-api-calls-with-mockoon/">https://blog-bertrand-thomas.devpro.fr/2022/03/09/mock-rest-api-calls-with-mockoon/</a></p>
<p>The Docker image is this, meaning it seems like we need to install npm:<br>
<a href="https://git.drupalcode.org/project/drupalci_environments/-/blob/dev/webdriver/chromedriver/Dockerfile?ref_type=heads">https://git.drupalcode.org/project/drupalci_environments/-/blob/dev/webdriver/chromedriver/Dockerfile?ref_type=heads</a></p>
<p>We could look into if we should create our own Docker image later to shave some seconds from testing, but for now this will work.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>In the prescript write a script that in the phpunit job:<br>
1. installs nodejs/npm<br>
2. downloads and starts mockoon-cli with the json file from this repo <a href="https://gitlab.com/freelygive/openai-api-mock">https://gitlab.com/freelygive/openai-api-mock</a>. This json file should be added to our repo, under tests.<br>
3. Do a test call using curl to see that its working.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue