drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

Add support in tests for serverApiProxy #206

Closed vloss3 closed 3 months ago

vloss3 commented 3 months ago

Motivation / Goals

Currently, the serverApiProxy option is set to false in tests due to tests using relative baseURL, e.g. baseURL: '/api'

Requirements

Tests use serverApiProxy feature. The mocked API uses an absolute URL.

Implementation notes

This is an issue because Vitest runs every test on a randomized port, a possible solution would be to find the current port and create an absolute URL, e.g. http://localhost:PORT/api

fago commented 3 months ago

fixed in #210