Skip to content

Commit

Permalink
Update test suite to reflect changes in v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPlayz0 committed Jan 24, 2024
1 parent 71786f4 commit 1556b2f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
33 changes: 15 additions & 18 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,24 @@ const api = new Server({
enabled: true,
folder: './routes',
context: context,
security: {
authentication: {
enabled: true,
methods: {
loggedIn: () => undefined,
hasPermission,
needsBot: () => undefined,
cumInAssable: () => undefined,
middleware: {
global: [
{
name: 'test',
when: 'precors',
handle: async (req, res, next) => {
console.log('this is before anything ever happens!');
next();
},
},
],
local: {
loggedIn: () => undefined,
hasPermission,
needsBot: () => undefined,
cumInAssable: () => undefined,
},
},
middleware: [
{
name: 'test',
when: 'precors',
handle: async (req, res, next) => {
console.log('this is before anything ever happens!');
next();
},
},
],
documentation: {
enabled: true,
open_api: {
Expand Down
18 changes: 8 additions & 10 deletions test/routes/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ export const configuration: RouteConfig = {
public: false,
operationId: 'api_root',
},
security: {
authentication: [
'loggedIn',
authenticationMethod('hasPermission', { where: (req) => req.query.any as string }),
{
method: 'cumInAssable',
data: 'anything',
},
],
},
middleware: [
'loggedIn',
authenticationMethod('hasPermission', { where: (req) => req.query.any as string }),
{
method: 'cumInAssable',
data: 'anything',
},
],
};

0 comments on commit 1556b2f

Please sign in to comment.