Issue with Zombie js testing on a local environment

I’ve replaced the default = ‘’;

with the following

Browser.localhost(‘localzombie.test’, (process.env.PORT || 3000));

In order to make requests to domain localzombie.test/, by executing the asynchronous callback

 suiteSetup(function (done) {
            return browser.visit('/', done);

which ought a be routed to localhost:3000.

However, the latter zombie.js test suite just throws error after error:

TypeError: Cannot read property ‘replace’ of undefined.

Hey! This is how I use Zombie with an example project hosted at http://localhost:3000 .

let Browser = require('zombie')

let browser = new Browser() = 'http://localhost:3000/'

let name = 'Poppy'

browser.visit('/welcome', () =>{

    browser.fill('#name', name)
    browser.pressButton('#submitname', () => {
        browser.assert.text('p#response', 'Welcome ' + name)
        console.log('All tests passed')

It seems to work for me, provided that the express app is running.

I’ll leave the code for the express server and index page below too, just in case:
Express Server:

let express = require('express')

let app = express()

app.get('/welcome', (request, response) => {
    response.sendFile(__dirname + '/welcome.html')

Welcome Page:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <h2 id='question'>What is your name?</h2>
    <input type='text' name='name' id='name'>
    <button id='submitname'
        onclick ="document.querySelector('#response').textContent = 'Welcome ' + document.querySelector('#name').value"
    >is my name.</button>
    <p id='response'></p>

Yep, with It works, since the host is directly specified.

However browser.localhost should set it to the hostname instead. Whenever you call browser.visit with any relative URL, with the callback suiteSetup, It appends the host to without being declared in the code.

I don’t understand why It fails with browser.localhost