Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions packages/express-wrapper/test/test-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { buildApiClient, supertestRequestFactory } from '@api-ts/superagent-wrap

import { createServer } from '../src';

// TODO: wallet-platform throws errors instead of returning values
const PutHello = httpRoute({
path: '/hello',
method: 'PUT',
Expand All @@ -30,12 +29,10 @@ const PutHello = httpRoute({
appMiddlewareRan: t.boolean,
routeMiddlewareRan: t.boolean,
}),
// In wallet-platform, sometimes we return a 202 (by throwing)
invalidRequest: t.type({
errors: t.string,
}),
notFound: t.unknown,
// 500s are also used on prime team
// DISCUSS: what if a response isn't listed here but shows up?
internalError: t.unknown,
},
Expand Down Expand Up @@ -84,7 +81,6 @@ test('should offer a delightful developer experience', async (t) => {
// Configure app-level middleware
app.use(express.json());
app.use(appMiddleware);
// Configure route-level middleware
return {
'hello.world': {
put: [routeMiddleware, CreateHelloWorld],
Expand Down Expand Up @@ -114,7 +110,6 @@ test('should invoke app-level middleware', async (t) => {
// Configure app-level middleware
app.use(express.json());
app.use(appMiddleware);
// Configure route-level middleware
return {
'hello.world': {
put: [CreateHelloWorld],
Expand All @@ -137,7 +132,6 @@ test('should invoke route-level middleware', async (t) => {
const app = createServer(ApiSpec, (app: express.Application) => {
// Configure app-level middleware
app.use(express.json());
// Configure route-level middleware
return {
'hello.world': {
put: [routeMiddleware, CreateHelloWorld],
Expand All @@ -160,7 +154,6 @@ test('should infer status code from response type', async (t) => {
const app = createServer(ApiSpec, (app: express.Application) => {
// Configure app-level middleware
app.use(express.json());
// Configure route-level middleware
return {
'hello.world': {
put: [CreateHelloWorld],
Expand All @@ -183,7 +176,6 @@ test('should return a 400 when request fails to decode', async (t) => {
const app = createServer(ApiSpec, (app: express.Application) => {
// Configure app-level middleware
app.use(express.json());
// Configure route-level middleware
return {
'hello.world': {
put: [CreateHelloWorld],
Expand Down