feat: creates support for swaps on the storefront (#355)

This commit is contained in:
Sebastian Rindom
2021-08-30 12:14:56 +02:00
committed by GitHub
parent bd1e115696
commit ae82cfc70a
20 changed files with 2122 additions and 1170 deletions
+14 -14
View File
@@ -3,39 +3,39 @@ const ServerTestUtil = {
app_: null,
setApp: function (app) {
this.app_ = app;
this.app_ = app
},
start: async function () {
this.server_ = await new Promise((resolve, reject) => {
const s = this.app_.listen(PORT, (err) => {
if (err) {
reject(err);
reject(err)
}
});
resolve(s);
});
})
resolve(s)
})
},
kill: function () {
return new Promise((resolve, _) => {
if (this.server_) {
this.server_.close(() => resolve());
this.server_.close(() => resolve())
}
resolve();
});
resolve()
})
},
};
}
const instance = ServerTestUtil;
const instance = ServerTestUtil
module.exports = {
setApp: function (app) {
instance.setApp(app);
return instance;
instance.setApp(app)
return instance
},
useServer: function () {
return instance;
return instance
},
};
}