Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: should export Application #6

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type { ContextDelegation as Context } from './context.js';
* Expose `Application` class.
* Inherits from `Emitter.prototype`.
*/
export default class Application extends Emitter {
export class Application extends Emitter {
/**
* Make HttpError available to consumers of the library so that consumers don't
* have a direct dependency upon `http-errors`
Expand Down Expand Up @@ -274,3 +274,5 @@ export default class Application extends Emitter {
res.end(body);
}
}

export default Application;
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Application from './application.js';
import { Application } from './application.js';

export default Application;

Expand Down
6 changes: 3 additions & 3 deletions test/application/context.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import assert from 'node:assert';
import request from 'supertest';
import Koa from '../../src/index.js';
import { Application } from '../../src/index.js';

describe('app.context', () => {
const app1 = new Koa();
const app1 = new Application();
app1.context.msg = 'hello app1';
const app2 = new Koa();
const app2 = new Application();
app2.request.foo = 'bar';

it('should the context between apps is isolated', () => {
Expand Down
Loading