Skip to content

Commit

Permalink
fix nest@8 compatibility of useFactory return type
Browse files Browse the repository at this point in the history
  • Loading branch information
iamolegga committed Aug 17, 2023
1 parent c917df0 commit e10644b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions __tests__/forRootAsync.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller, Get, Module, Session } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';

import { SessionModule } from '../src';
import { NestSessionOptions, SessionModule } from '../src';

import { platforms } from './utils/platforms';
import { doubleRequest } from './utils/request';
Expand All @@ -26,7 +26,11 @@ describe(SessionModule.forRootAsync.name, () => {
@Module({
imports: [
SessionModule.forRootAsync({
useFactory: () => ({ session: { secret: 'test' } }),
useFactory: ():
| NestSessionOptions
| Promise<NestSessionOptions> => ({
session: { secret: 'test' },
}),
}),
],
controllers: [TestController],
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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 @@ -40,7 +40,7 @@
},
"homepage": "https://github.com/iamolegga/nestjs-session#readme",
"dependencies": {
"create-nestjs-middleware-module": "^0.3.0"
"create-nestjs-middleware-module": "^0.3.1"
},
"devDependencies": {
"@nestjs/common": "^10.1.3",
Expand Down

0 comments on commit e10644b

Please sign in to comment.