Skip to content

Commit

Permalink
fix: failing router tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukejkw committed Aug 11, 2023
1 parent 4c5e8ed commit 8e713d0
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
workflow_dispatch:
jobs:
build:
job:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ A super simple lightweight extensible router to take the AWS Lambda routing pain

## Features

- Easy to use
- Easy to extend
- Simple to use
- Extensible
- Tiny
- Includes TypeScript types

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
transform: {
'^.+\\.ts$': 'ts-jest'
},
reporters: [ 'default', 'jest-junit' ]
reporters: [ 'default' ]
};
51 changes: 0 additions & 51 deletions junit.xml

This file was deleted.

43 changes: 0 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@types/aws-lambda": "^8.10.119",
"@types/jest": "^29.5.3",
"jest": "^29.6.2",
"jest-junit": "^16.0.0",
"ts-jest": "^29.1.1"
},
"dependencies": {
Expand Down
11 changes: 11 additions & 0 deletions src/http.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
export enum HttpMethod {
Post = 'POST',
Get = 'GET',
Head = 'HEAD',
Options = 'OPTIONS',
Put = 'PUT',
Patch = 'PATCH',
Delete = 'DELETE',
Any = '*'
}

export enum HttpStatus {
OK = 200,
NotFound = 404,
Expand Down
2 changes: 1 addition & 1 deletion src/matcher.tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APIGatewayProxyEventV2 } from 'aws-lambda';
import { HttpMethod } from './http/method';
import { HttpMethod } from './http';
import { matchEverything, methodMatcher } from './matchers';
import { randomInt } from 'crypto';

Expand Down
2 changes: 1 addition & 1 deletion src/matchers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APIGatewayProxyEventV2 } from 'aws-lambda';
import { HttpMethod } from './http/method';
import { HttpMethod } from './http';

export type Matcher = (proxyEvent: APIGatewayProxyEventV2) => boolean;

Expand Down
2 changes: 1 addition & 1 deletion src/router.tests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 } from 'aws-lambda';
import { Route, router } from '.';
import { matchEverything } from './matchers';
import { HttpStatus } from './http/status';
import { HttpStatus } from './http';

jest.mock('./logger', () => ({
createLogger: () => ({
Expand Down

0 comments on commit 8e713d0

Please sign in to comment.