@rosen-bridge/config 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +0,0 @@
1
- import fs from 'fs';
2
- import os from 'os';
3
- import path from 'path';
4
- import { v4 as uuidv4 } from 'uuid';
5
-
6
- /**
7
- * sets up environment for config tests
8
- *
9
- * @param {Record<string, string>} envVars list of environment variables to be
10
- * set for tests
11
- * @return {{
12
- * configDir: string;
13
- * }}
14
- */
15
- const setupConfigTestEnv = (
16
- envVars: Record<string, any>
17
- ): {
18
- configDir: string;
19
- } => {
20
- const configDir = fs.mkdtempSync(
21
- path.join(os.tmpdir(), `config-${uuidv4()}`)
22
- );
23
- process.env['NODE_CONFIG_DIR'] = configDir;
24
- fs.cpSync(path.join(__dirname, 'configTestFiles'), configDir, {
25
- recursive: true,
26
- });
27
-
28
- for (const [name, val] of Object.entries(envVars)) {
29
- process.env[name] = val;
30
- }
31
- return { configDir };
32
- };
33
-
34
- export const { configDir } = setupConfigTestEnv({ SERVER_URL: 'some-url.org' });