The easiest way to do it IMHO would be to spin up another instance of your application with different configuration, namely connecting to a different database and listening on a different port. Then you can point Selenium to it. In theory the FE of the application should be port agnostic, however if that presents a problem, nginx can be of a great help.
Let's consider you want it on port 3333 and domain test.myapp. Here is sample configuration file for nginx.
server {
listen 80;
server_name test.myapp;
location / {
proxy_pass http://localhost:3333;
proxy_set_header Host $host;
proxy_buffering off;
}
}
Of course you would like to have another server defined for your current development server. Simply rinse and repeat.
Usually the configuration in a nodejs application is chosen based on the value of environmental variable NODE_ENV. You can pass it like so, when you run your app (I am assuming here it is a Linux server):
$ NODE_ENV=test node app.js
Then inside your application you would easily get access to it:
var env = process.env.NODE_ENV
I hope it helps.