Next Phenomenal Microbrewery


    1.0.0 • Public • Published


    This module can used in Node JS applications to mimic the environment variables used in a different environment

    To test this module, run the following commands:

    • yarn install
    • yarn test


    Downloading environment variables file

    In the module where the functional tests will be run, you need to firstly download the json file with the environment variable configurations. This file can be found in the Azure project of which environment variables you want to mimic locally. For example, this is the URL for the environment variables file for the RFE project in AAT:


    In order to log in, you'll have to enter your SCM credentials. These can be registered in Azure. Once you have access to this file, just save it as a json file anywhere in your computer. If you choose to save it in your project, don't forget to add this file to .gitignore so that you don't check this into GitHub (exposing secrets).

    Installing the package in your project

    To install this as a dev dependency in your project, just run:

    yarn add "" -D

    Having environment variables changed on the fly for your test

    const processEnvironmentSetup = require('@hmcts/node-js-environment-variable-setter');
    const configurationFile = './remote-config.json'; //This will be the path to the file you saved with the environment variables

    From this point onwards, your project will have the same environment variables set in the json file (with the exception of the ignored properties - you can find this list in this module's source code).




    npm i @hmcts/environment-variable-setter

    DownloadsWeekly Downloads






    Unpacked Size

    6.92 kB

    Total Files


    Last publish


    • timja
    • andrewwa-kainos
    • bendiggle
    • ellie-harrison
    • adrianc
    • hemantt
    • adamsilver
    • trevorsaint
    • timja-hmcts
    • dharmendrak
    • robertparkinson
    • pragnesh
    • damdun
    • p.jar
    • sabah.irfan
    • jenkins-reform-hmcts