cypress 5.4.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,80 @@
1
- /**
2
- * HTTP request/response types.
3
- */
1
+ // Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/methods/index.d.ts
2
+ type Method =
3
+ | 'ACL'
4
+ | 'BIND'
5
+ | 'CHECKOUT'
6
+ | 'CONNECT'
7
+ | 'COPY'
8
+ | 'DELETE'
9
+ | 'GET'
10
+ | 'HEAD'
11
+ | 'LINK'
12
+ | 'LOCK'
13
+ | 'M-SEARCH'
14
+ | 'MERGE'
15
+ | 'MKACTIVITY'
16
+ | 'MKCALENDAR'
17
+ | 'MKCOL'
18
+ | 'MOVE'
19
+ | 'NOTIFY'
20
+ | 'OPTIONS'
21
+ | 'PATCH'
22
+ | 'POST'
23
+ | 'PROPFIND'
24
+ | 'PROPPATCH'
25
+ | 'PURGE'
26
+ | 'PUT'
27
+ | 'REBIND'
28
+ | 'REPORT'
29
+ | 'SEARCH'
30
+ | 'SOURCE'
31
+ | 'SUBSCRIBE'
32
+ | 'TRACE'
33
+ | 'UNBIND'
34
+ | 'UNLINK'
35
+ | 'UNLOCK'
36
+ | 'UNSUBSCRIBE'
37
+ | 'acl'
38
+ | 'bind'
39
+ | 'checkout'
40
+ | 'connect'
41
+ | 'copy'
42
+ | 'delete'
43
+ | 'get'
44
+ | 'head'
45
+ | 'link'
46
+ | 'lock'
47
+ | 'm-search'
48
+ | 'merge'
49
+ | 'mkactivity'
50
+ | 'mkcalendar'
51
+ | 'mkcol'
52
+ | 'move'
53
+ | 'notify'
54
+ | 'options'
55
+ | 'patch'
56
+ | 'post'
57
+ | 'propfind'
58
+ | 'proppatch'
59
+ | 'purge'
60
+ | 'put'
61
+ | 'rebind'
62
+ | 'report'
63
+ | 'search'
64
+ | 'source'
65
+ | 'subscribe'
66
+ | 'trace'
67
+ | 'unbind'
68
+ | 'unlink'
69
+ | 'unlock'
70
+ | 'unsubscribe'
71
+
4
72
  export namespace CyHttpMessages {
5
73
  interface BaseMessage {
6
74
  body?: any
7
75
  headers: { [key: string]: string }
8
76
  url: string
9
- method?: string
77
+ method?: Method
10
78
  httpVersion?: string
11
79
  }
12
80
 
@@ -177,7 +245,7 @@ export interface RouteMatcherOptionsGeneric<S> extends RouteMatcherCompatOptions
177
245
  https?: boolean
178
246
  /**
179
247
  * Match against the request's HTTP method.
180
- * @default 'GET'
248
+ * @default '*'
181
249
  */
182
250
  method?: S
183
251
  /**
@@ -289,7 +357,7 @@ declare global {
289
357
  * @example
290
358
  * cy.route2('GET', 'http://foo.com/fruits', ['apple', 'banana', 'cherry'])
291
359
  */
292
- route2(method: string, url: RouteMatcher, response?: RouteHandler): Chainable<null>
360
+ route2(method: Method, url: RouteMatcher, response?: RouteHandler): Chainable<null>
293
361
  }
294
362
  }
295
363
  }