@@ -16,16 +16,16 @@ describe('feathers-primus', () => {
1616 } ;
1717
1818 before ( done => {
19- const errorHook = function ( hook ) {
20- if ( hook . params . query . hookError ) {
19+ const errorHook = function ( hook ) {
20+ if ( hook . params . query . hookError ) {
2121 throw new Error ( `Error from ${ hook . method } , ${ hook . type } hook` ) ;
2222 }
2323 } ;
2424 const app = options . app = feathers ( )
2525 . configure ( hooks ( ) )
2626 . configure ( primus ( {
2727 transformer : 'websockets'
28- } , function ( primus ) {
28+ } , function ( primus ) {
2929 options . socket = new primus . Socket ( 'http://localhost:7888' ) ;
3030
3131 primus . authorize ( function ( req , done ) {
@@ -39,7 +39,7 @@ describe('feathers-primus', () => {
3939 get : errorHook
4040 } ) ;
4141
42- options . server = app . listen ( 7888 , function ( ) {
42+ options . server = app . listen ( 7888 , function ( ) {
4343 app . use ( 'tasks' , todoService ) ;
4444 app . service ( 'tasks' ) . before ( {
4545 get : errorHook
@@ -57,32 +57,32 @@ describe('feathers-primus', () => {
5757 assert . equal ( typeof require ( '../lib' ) , 'function' ) ;
5858 } ) ;
5959
60- it ( 'runs primus before setup (#131)' , function ( done ) {
60+ it ( 'runs primus before setup (#131)' , function ( done ) {
6161 var counter = 0 ;
6262 var app = feathers ( )
6363 . configure ( primus ( {
6464 transformer : 'websockets'
65- } , function ( ) {
65+ } , function ( ) {
6666 assert . equal ( counter , 0 ) ;
6767 counter ++ ;
6868 } ) )
6969 . use ( '/todos' , {
70- find : function ( params , callback ) {
70+ find : function ( params , callback ) {
7171 callback ( null , [ ] ) ;
7272 } ,
73- setup : function ( app ) {
73+ setup : function ( app ) {
7474 assert . ok ( app . primus ) ;
7575 assert . equal ( counter , 1 , 'SocketIO configuration ran first' ) ;
7676 }
7777 } ) ;
7878
7979 var srv = app . listen ( 9119 ) ;
80- srv . on ( 'listening' , function ( ) {
80+ srv . on ( 'listening' , function ( ) {
8181 srv . close ( done ) ;
8282 } ) ;
8383 } ) ;
8484
85- it ( 'Passes handshake as service parameters.' , function ( done ) {
85+ it ( 'Passes handshake as service parameters.' , function ( done ) {
8686 var service = options . app . service ( 'todo' ) ;
8787 var old = {
8888 find : service . find ,
@@ -91,19 +91,19 @@ describe('feathers-primus', () => {
9191 remove : service . remove
9292 } ;
9393
94- service . find = function ( params ) {
94+ service . find = function ( params ) {
9595 assert . deepEqual ( _ . omit ( params , 'query' ) , options . socketParams ,
9696 'Handshake parameters passed on proper position' ) ;
9797 old . find . apply ( this , arguments ) ;
9898 } ;
9999
100- service . create = function ( data , params ) {
100+ service . create = function ( data , params ) {
101101 assert . deepEqual ( _ . omit ( params , 'query' ) , options . socketParams ,
102102 'Passed handshake parameters' ) ;
103103 old . create . apply ( this , arguments ) ;
104104 } ;
105105
106- service . update = function ( id , data , params ) {
106+ service . update = function ( id , data , params ) {
107107 assert . deepEqual ( params , _ . extend ( {
108108 query : {
109109 test : 'param'
@@ -113,20 +113,20 @@ describe('feathers-primus', () => {
113113 } ;
114114
115115 options . socket . send ( 'todo::create' , { } , { } , function ( ) {
116- options . socket . send ( 'todo::update' , 1 , { } , { test : 'param' } , function ( ) {
116+ options . socket . send ( 'todo::update' , 1 , { } , { test : 'param' } , function ( ) {
117117 _ . extend ( service , old ) ;
118118 done ( ) ;
119119 } ) ;
120120 } ) ;
121121 } ) ;
122122
123- it ( 'Missing parameters in socket call works. (#88)' , function ( done ) {
123+ it ( 'Missing parameters in socket call works. (#88)' , function ( done ) {
124124 var service = options . app . service ( 'todo' ) ;
125125 var old = {
126126 find : service . find
127127 } ;
128128
129- service . find = function ( params ) {
129+ service . find = function ( params ) {
130130 assert . deepEqual ( _ . omit ( params , 'query' ) , options . socketParams ,
131131 'Handshake parameters passed on proper position' ) ;
132132 old . find . apply ( this , arguments ) ;
@@ -143,7 +143,7 @@ describe('feathers-primus', () => {
143143 const sub = feathers ( )
144144 . configure ( primus ( {
145145 transformer : 'websockets'
146- } , function ( primus ) {
146+ } , function ( primus ) {
147147 const socket = new primus . Socket ( 'http://localhost:9876' ) ;
148148
149149 const original = {
@@ -160,17 +160,17 @@ describe('feathers-primus', () => {
160160 } ) )
161161 . use ( '/todo' , todoService ) ;
162162
163- const main = feathers ( )
163+ const main = feathers ( )
164164 . use ( '/v1' , sub ) ;
165165
166- server = main . listen ( 9876 ) ;
166+ server = main . listen ( 9876 ) ;
167167 } ) ;
168168
169- describe ( 'Services' , function ( ) {
169+ describe ( 'Services' , function ( ) {
170170 services ( 'todo' , options ) ;
171171 } ) ;
172172
173- describe ( 'Dynamic services' , function ( ) {
173+ describe ( 'Dynamic services' , function ( ) {
174174 services ( 'tasks' , options ) ;
175175 } ) ;
176176} ) ;
0 commit comments