diff --git a/test/1022.spec.ts b/test/1022.spec.ts index 0c770fa9..26e22389 100644 --- a/test/1022.spec.ts +++ b/test/1022.spec.ts @@ -125,10 +125,10 @@ describe(packageJson.name, () => { .get(`/api/test/:id`, (req, res) => res.status(200).json({ id: 'id-test', label: 'label' }), ) - .post(`/api/test/:id:clone`, (req, res) => + .post(`/api/test/:id\\:clone`, (req, res) => res.status(200).json({ ...req.body, id: 'id-test' }), ) - .get('/api/some/:wildcard(*)', (req, res) => { + .get('/api/some/:wildcard(*wildcard)', (req, res) => { const wildcard = req.params.wildcard; console.log(`Wildcard: ${wildcard}`); res.status(200).send(`Matched wildcard: ${wildcard}`); diff --git a/test/699.spec.ts b/test/699.spec.ts index 4e3399e2..873b06a2 100644 --- a/test/699.spec.ts +++ b/test/699.spec.ts @@ -53,7 +53,7 @@ describe('699', () => { }, 3005, (app) => { - app.get([`${app.basePath}/users/:id?`], (req, res) => { + app.get([`${app.basePath}/users/{:id}`], (req, res) => { if (typeof req.params.id !== 'object') { throw new Error("Should be deserialized to ObjectId object"); } @@ -181,7 +181,7 @@ describe('699 serialize response components only', () => { }, 3005, (app) => { - app.get([`${app.basePath}/users/:id?`], (req, res) => { + app.get([`${app.basePath}/users/{:id}`], (req, res) => { if (typeof req.params.id !== 'string') { throw new Error("Should be not be deserialized to ObjectId object"); } diff --git a/test/multipart.spec.ts b/test/multipart.spec.ts index 807e3759..b42cc64e 100644 --- a/test/multipart.spec.ts +++ b/test/multipart.spec.ts @@ -33,7 +33,7 @@ describe('a multipart request', () => { metadata: req.body.metadata, }); }) - .post(`/sample_*`, (req, res) => res.json(req.body)), + .post(`/sample_*suffix`, (req, res) => res.json(req.body)), ), ); }); diff --git a/test/path.params.spec.ts b/test/path.params.spec.ts index 57bde2e7..b91360cf 100644 --- a/test/path.params.spec.ts +++ b/test/path.params.spec.ts @@ -18,7 +18,7 @@ describe('path params', () => { 3005, (app) => { app.get( - [`${app.basePath}/users/:id?`, `${app.basePath}/users_alt/:id?`], + [`${app.basePath}/users/{:id}`, `${app.basePath}/users_alt/{:id}`], (req, res) => { res.json({ id: req.params.id, @@ -30,7 +30,7 @@ describe('path params', () => { id: req.params.name, }); }); - app.get(`${app.basePath}/multi_users/:ids?`, (req, res) => { + app.get(`${app.basePath}/multi_users/{:ids}`, (req, res) => { res.json({ ids: req.params.ids, }); diff --git a/test/serdes.spec.ts b/test/serdes.spec.ts index 25774403..d68b25c7 100644 --- a/test/serdes.spec.ts +++ b/test/serdes.spec.ts @@ -62,7 +62,7 @@ describe('serdes', () => { }, 3005, (app) => { - app.get([`${app.basePath}/users/:id?`], (req, res) => { + app.get([`${app.basePath}/users/{:id}`], (req, res) => { if (typeof req.params.id !== 'object') { throw new Error("Should be deserialized to ObjectId object"); } @@ -237,7 +237,7 @@ describe('serdes serialize response components only', () => { }, 3005, (app) => { - app.get([`${app.basePath}/users/:id?`], (req, res) => { + app.get([`${app.basePath}/users/{:id}`], (req, res) => { if (typeof req.params.id !== 'string') { throw new Error("Should be not be deserialized to ObjectId object"); } @@ -431,7 +431,7 @@ describe('serdes with array type string-list', () => { }, 3005, (app) => { - app.get([`${app.basePath}/users/:id?`], (req, res) => { + app.get([`${app.basePath}/users/{:id}`], (req, res) => { if (typeof req.params.id !== 'object') { throw new Error("Should be deserialized to ObjectId object"); }