File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1- import { guard , sessionManager } from "./sessionManager.js" ;
1+ import { guard , middleware , useSessionInViews } from "./sessionManager.js" ;
22
33describe ( "sessionManager" , ( ) => {
44 it ( "Deberia exportar guard como funcion" , ( ) => {
55 expect ( typeof guard ) . toBe ( "function" ) ;
66 } ) ;
7+
8+ it ( "Deberia exportar middleware como funcion" , ( ) => {
9+ expect ( typeof middleware ) . toBe ( "function" ) ;
10+ } ) ;
11+
12+ it ( "Deberia exportar useSessionInViews como funcion" , ( ) => {
13+ expect ( typeof useSessionInViews ) . toBe ( "function" ) ;
14+ } ) ;
15+
16+ it ( "useSessionInViews deberia llamar siempre a la funcion next" , ( ) => {
17+ const next = jest . fn ( ) ;
18+ const req = { } ;
19+ const res = { locals : { } } ;
20+ useSessionInViews ( req , res , next ) ;
21+ expect ( next ) . toHaveBeenCalled ( ) ;
22+ expect ( next ) . toHaveBeenCalledTimes ( 1 ) ;
23+ } ) ;
724} ) ;
You can’t perform that action at this time.
0 commit comments