Last active
February 17, 2023 06:11
-
-
Save rjpkuyper/c824b276f733260d5b79f70c56d391c7 to your computer and use it in GitHub Desktop.
Test the env vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createUrl, Paths } from './get-env-vars' | |
describe("GetEnvVars", () => { | |
const OLD_ENV = process.env; | |
beforeEach(() => { | |
process.env = { ...OLD_ENV }; | |
delete process.env.NODE_ENV; | |
}); | |
afterEach(() => { | |
process.env = OLD_ENV; | |
}); | |
test('should create a new url', () => { | |
process.env.BASE_URL = 'https://example.com'; | |
expect(createUrl(Paths.PRODUCTS)).toEqual(`${process.env.BASR_URL}/${Paths.PRODUCTS}`); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment