File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 50
50
"@japa/expect-type" : " ^2.0.3" ,
51
51
"@japa/file-system" : " ^2.3.2" ,
52
52
"@japa/plugin-adonisjs" : " ^4.0.0" ,
53
- "@japa/runner" : " 4.1 .0" ,
53
+ "@japa/runner" : " 4.2 .0" ,
54
54
"@japa/snapshot" : " ^2.0.8" ,
55
55
"@release-it/conventional-changelog" : " ^10.0.0" ,
56
- "@swc/core" : " ^ 1.10.11 " ,
56
+ "@swc/core" : " 1.10.7 " ,
57
57
"@types/node" : " ^22.12.0" ,
58
58
"@types/qs" : " ^6.9.18" ,
59
59
"@types/supertest" : " ^6.0.2" ,
Original file line number Diff line number Diff line change @@ -119,19 +119,27 @@ export function inertiaApiClient(app: ApplicationService): PluginFn {
119
119
ApiResponse . macro (
120
120
'assertInertiaProps' ,
121
121
function ( this : ApiResponse , props : Record < string , unknown > ) {
122
- this . ensureHasAssert ( )
122
+ if ( ! this . assert ) {
123
+ throw new Error (
124
+ 'Response assertions are not available. Make sure to install the @japa/assert plugin'
125
+ )
126
+ }
123
127
ensureIsInertiaResponse . call ( this )
124
- this . assert ! . deepEqual ( this . body ( ) . props , props )
128
+ this . assert . deepEqual ( this . body ( ) . props , props )
125
129
return this
126
130
}
127
131
)
128
132
129
133
ApiResponse . macro (
130
134
'assertInertiaPropsContains' ,
131
135
function ( this : ApiResponse , props : Record < string , unknown > ) {
132
- this . ensureHasAssert ( )
136
+ if ( ! this . assert ) {
137
+ throw new Error (
138
+ 'Response assertions are not available. Make sure to install the @japa/assert plugin'
139
+ )
140
+ }
133
141
ensureIsInertiaResponse . call ( this )
134
- this . assert ! . containsSubset ( this . body ( ) . props , props )
142
+ this . assert . containsSubset ( this . body ( ) . props , props )
135
143
return this
136
144
}
137
145
)
You can’t perform that action at this time.
0 commit comments