Skip to content

Commit

Permalink
refactor(tests): moved from callback approach to sync one, add tests …
Browse files Browse the repository at this point in the history
…to adapter (#29)

* refactor(tests): moved from callback approach to sync one, add tests for http adapter

* chore(examples/ws): bump version to 8.16
  • Loading branch information
Danilqa authored Jan 19, 2024
1 parent 2476aa0 commit 59ebbe3
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 177 deletions.
2 changes: 1 addition & 1 deletion examples/web-socket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"node-file-router": "workspace:../../dist",
"ws": "8.15.0"
"ws": "8.16.0"
},
"devDependencies": {
"@types/node": "20.1.4",
Expand Down
8 changes: 4 additions & 4 deletions examples/web-socket/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types --rootDir src",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"lint": "eslint src",
"lint": "eslint src tests",
"prepare": "husky install"
},
"module": "./esm/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/file-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { isFunction, isRecordWith } from './utils/object.utils';
import { resolveNotFoundHandler } from './components/not-found-resolver';
import { httpAdapter } from './adapters/http-adapter';
import { validateBaseDirExistence } from './validations/validations';

import { executeWithMiddlewares } from './components/middleware-executer';

import type { Adapter } from './types/adapter';
import type { RequestHandler } from './types/request-handlers';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createTestRequestHandler } from '../../../../test-utils';

export default createTestRequestHandler(__filename);
export default createTestRequestHandler(__filename);
3 changes: 3 additions & 0 deletions tests/api-for-adapter/endpoint.[custom].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createTestRequestHandler } from '../test-utils';

export default createTestRequestHandler(__filename);
3 changes: 3 additions & 0 deletions tests/api-for-adapter/exact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createTestRequestHandler } from '../test-utils';

export default createTestRequestHandler(__filename);
Loading

0 comments on commit 59ebbe3

Please # to comment.