Skip to content

Commit

Permalink
feat(for mock and keplo): log which in mode keploy is running
Browse files Browse the repository at this point in the history
review changes

Signed-off-by: Vishal Myla <[email protected]>
  • Loading branch information
VishalMyla committed Apr 3, 2023
1 parent d3af002 commit 0c2d419
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mock/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export function NewContext(conf: Config) {
if (Mode.Valid(conf.Mode)) {
mode.SetMode(conf.Mode);
}

// log the value of the mode
console.log("keploy is in :", mode, " mode");
switch (mode.GetMode()) {
case "test":
if (conf.Name === "") {
Expand Down
7 changes: 7 additions & 0 deletions src/keploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,28 @@ export default class Keploy {
) {
// extract config from environment variables
this.mode = new Mode();

if (
process.env.KEPLOY_MODE !== undefined &&
Mode.Valid(process.env.KEPLOY_MODE)
) {
this.mode.SetMode(process.env.KEPLOY_MODE);
}

this.appConfig = this.validateAppConfig(app);
this.serverConfig = this.validateServerConfig(server);
this.grpcClient = new grpcObj.services.RegressionService(
this.serverConfig.url,
grpc.credentials.createInsecure()
);

this.responses = {};
this.dependencies = {};
this.mocks = {};

console.log("Keploy running in: ", process.env.KEPLOY_MODE, " mode");


}

validateServerConfig({
Expand Down

0 comments on commit 0c2d419

Please sign in to comment.