We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aca79b4 commit 259c66aCopy full SHA for 259c66a
test/__mocks__/cf-env.js
@@ -1,17 +1,21 @@
1
"use strict";
2
3
-const cfEnv = {
+class CfEnv {
4
_reset() {
5
this.isOnCf = false;
6
this.cfApp = {};
7
this.cfServices = {};
8
this.cfServiceCredentialsForLabel = jest.fn().mockReturnValue({});
9
- },
10
-};
11
-cfEnv._reset();
12
-
13
-const CfEnv = {
14
- getInstance: () => cfEnv,
15
+ }
+ constructor() {
+ this._reset();
+ static getInstance() {
+ if (!CfEnv.__instance) {
+ CfEnv.__instance = new CfEnv();
16
17
+ return CfEnv.__instance;
18
19
+}
20
21
module.exports = { CfEnv };
0 commit comments