@@ -7,12 +7,8 @@ var flash = require('flash');
7
7
function MockRequest ( ) {
8
8
this . session = { } ;
9
9
}
10
-
11
- function MockRequestWithoutSession ( ) {
12
- }
13
-
14
- function MockResponse ( ) {
15
- }
10
+ function MockRequestWithoutSession ( ) { }
11
+ function MockResponse ( ) { }
16
12
17
13
18
14
vows . describe ( 'flash' ) . addBatch ( {
@@ -54,6 +50,15 @@ vows.describe('flash').addBatch({
54
50
assert . equal ( msgs [ 0 ] , 'Something went wrong' ) ;
55
51
assert . lengthOf ( Object . keys ( req . session . flash ) , 0 ) ;
56
52
} ,
53
+ 'should set/get flash unicode message' : function ( err , req , res ) {
54
+ const count = req . flash ( 'error' , 'a Ā 𐀀 文 🦄' ) ;
55
+ assert . equal ( count , 1 ) ;
56
+ assert . equal ( req . session . flash . error [ 0 ] , 'YSDEgCDwkICAIOaWhyDwn6aE' ) ;
57
+ const msgs = req . flash ( 'error' ) ;
58
+ assert . lengthOf ( msgs , 1 ) ;
59
+ assert . equal ( msgs [ 0 ] , 'a Ā 𐀀 文 🦄' ) ;
60
+ assert . lengthOf ( Object . keys ( req . session . flash ) , 0 ) ;
61
+ } ,
57
62
'should set multiple flash messages' : function ( err , req , res ) {
58
63
req . flash ( 'info' , 'Welcome' ) ;
59
64
var count = req . flash ( 'info' , 'Check out this great new feature' ) ;
0 commit comments