feat: Typescript for API layer (#817)

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Sebastian Rindom <seb@medusa-commerce.com>
This commit is contained in:
Oliver Windall Juhl
2021-11-18 15:19:17 +01:00
committed by GitHub
co-authored by Philip Korsholm Zakaria El Asri Kasper Fabricius Kristensen Philip Korsholm Sebastian Rindom
parent 55e200bf68
commit 373532ecbc
413 changed files with 20957 additions and 10349 deletions
@@ -5,8 +5,6 @@ const setupServer = require("../../../helpers/setup-server")
const { useApi } = require("../../../helpers/use-api")
const { initDb, useDb } = require("../../../helpers/use-db")
const customerSeeder = require("../../helpers/customer-seeder")
jest.setTimeout(30000)
describe("/store/customers", () => {
@@ -113,21 +111,22 @@ describe("/store/customers", () => {
password: "test",
})
const customerId = authResponse.data.customer.id
const [authCookie] = authResponse.headers["set-cookie"][0].split(";")
const response = await api.post(
`/store/customers/me`,
{
password: "test",
metadata: { key: "value" },
},
{
headers: {
Cookie: authCookie,
const response = await api
.post(
`/store/customers/me`,
{
password: "test",
metadata: { key: "value" },
},
}
)
{
headers: {
Cookie: authCookie,
},
}
)
.catch((e) => console.log("err", e))
expect(response.status).toEqual(200)
expect(response.data.customer).not.toHaveProperty("password_hash")
@@ -146,7 +145,6 @@ describe("/store/customers", () => {
password: "test",
})
const customerId = authResponse.data.customer.id
const [authCookie] = authResponse.headers["set-cookie"][0].split(";")
const response = await api.post(
@@ -192,7 +190,6 @@ describe("/store/customers", () => {
password: "test",
})
const customerId = authResponse.data.customer.id
const [authCookie] = authResponse.headers["set-cookie"][0].split(";")
const response = await api.post(
@@ -230,7 +227,6 @@ describe("/store/customers", () => {
password: "test",
})
const customerId = authResponse.data.customer.id
const [authCookie] = authResponse.headers["set-cookie"][0].split(";")
const check = await api.post(