Open
Description
Jest tests for next-drupal
fail when run locally.
Expected behavior
The TESTING.md documentation tells a developer how to run the tests and the local tests run successfully.
Steps to reproduce:
git clone
this repo.- Run
yarn install
- Running
yarn test
fails all tests with:
FAIL packages/next-drupal/tests/crud.test.ts
● Test suite failed to run
The 'baseUrl' param is required.
125 | constructor(baseUrl: BaseUrl, options: DrupalClientOptions = {}) {
126 | if (!baseUrl || typeof baseUrl !== "string") {
> 127 | throw new Error("The 'baseUrl' param is required.")
| ^
128 | }
FAIL packages/next-drupal/tests/client.test.ts
● Test suite failed to run
The 'baseUrl' param is required.
125 | constructor(baseUrl: BaseUrl, options: DrupalClientOptions = {}) {
126 | if (!baseUrl || typeof baseUrl !== "string") {
> 127 | throw new Error("The 'baseUrl' param is required.")
| ^
128 | }
Additional context
It's obvious from the Jest failure messages that there are some missing environment variables. It's also clear from looking at the Jest snapshot file, that the Jest tests are being run against a specific live environment, https://tests.next-drupal.org, and are using specific authentication credentials. So we can't allow developers to have those environment variables.
Developers should be able to have local test fixtures to run tests locally.