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

test(express-session): テストの追加 #5

Merged
merged 4 commits into from
Oct 7, 2018
Merged

test(express-session): テストの追加 #5

merged 4 commits into from
Oct 7, 2018

Conversation

Himenon
Copy link
Owner

@Himenon Himenon commented Oct 7, 2018

下記のテストを追加

  • 非ログイン
  • ログイン
  • リクエストに依存しないの関数

追加実装

  • portfinderを利用
    • テスト時にportがかぶる事があるため
  • session.destory()を利用
    • ログアウト時
  • npm-run-all
    • テストと、tscを同時に回すため

@coveralls
Copy link

Pull Request Test Coverage Report for Build 25

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+24.3%) to 98.701%

Totals Coverage Status
Change from base Build 17: 24.3%
Covered Lines: 64
Relevant Lines: 64

💛 - Coveralls

@Himenon Himenon merged commit 8038949 into master Oct 7, 2018
@@ -123,15 +117,17 @@ app.route('/logout')
next: express.NextFunction
) => {
if (req.session) {
req.session.userName = undefined;
req.session.destroy(() => undefined);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

変更

}
res.redirect('/login');
}
);

const server = app.listen(3000, () => console.log('Example app listening on port 3000!'));
portfinder.getPort({ port: 3000 }, (error: any, port: number) => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

portfinderを追加

"tsc:watch": "tsc -p tsconfig.json --watch",
"express:session": "node ./lib/express-session/oneshot.js",
"lint": "tslint -c tslint.json -p tsconfig.json",
"lint:fix": "yarn run lint -- --fix",
"test": "jest -c jest.config.json",
"test": "jest -c jest.config.json --detectOpenHandles",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants