File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 125
125
return result ;
126
126
}
127
127
128
- api . get = api . set = api ;
128
+ api . set = api ;
129
+ api . get = function ( key ) {
130
+ return api ( key ) ;
131
+ } ;
129
132
api . getJSON = function ( ) {
130
133
return api . apply ( {
131
134
json : true
Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ QUnit.test('Call to read cookie when there is another unrelated cookie with malf
89
89
Cookies . withConverter ( unescape ) . remove ( 'invalid' ) ;
90
90
} ) ;
91
91
92
+ // github.com/js-cookie/js-cookie/issues/145
93
+ QUnit . test ( 'Call to read cookie when passing an Object Literal as the second argument' , function ( assert ) {
94
+ assert . expect ( 1 ) ;
95
+ Cookies . get ( 'name' , { path : '' } ) ;
96
+ assert . strictEqual ( document . cookie , '' , 'should not create a cookie' ) ;
97
+ } ) ;
98
+
92
99
QUnit . module ( 'write' , lifecycle ) ;
93
100
94
101
QUnit . test ( 'String primitive' , function ( assert ) {
You can’t perform that action at this time.
0 commit comments