|
5 | 5 | isRedirect, |
6 | 6 | isClientError, |
7 | 7 | isServerError, |
8 | | -} from '../src'; |
| 8 | + Method, |
| 9 | +} from '../dist'; |
9 | 10 |
|
10 | 11 | type Test = [ |
11 | 12 | Status, |
@@ -115,21 +116,39 @@ const tests: Test[] = [ |
115 | 116 | tests.map( |
116 | 117 | ([status, [informational, success, redirect, clientError, serverError]]) => { |
117 | 118 | describe(`[${status}]`, () => { |
118 | | - it('[isInformational]', () => { |
| 119 | + it(`isInformational |> ${informational}`, () => { |
119 | 120 | expect(isInformational(status)).toEqual(informational); |
120 | 121 | }); |
121 | | - it('[isSuccess]', () => { |
| 122 | + it(`isSuccess |> ${success}`, () => { |
122 | 123 | expect(isSuccess(status)).toEqual(success); |
123 | 124 | }); |
124 | | - it('[isRedirect]', () => { |
| 125 | + it(`isRedirect |> ${redirect}`, () => { |
125 | 126 | expect(isRedirect(status)).toEqual(redirect); |
126 | 127 | }); |
127 | | - it('[isClientError]', () => { |
| 128 | + it(`isClientError |> ${clientError}`, () => { |
128 | 129 | expect(isClientError(status)).toEqual(clientError); |
129 | 130 | }); |
130 | | - it('[isServerError]', () => { |
| 131 | + it(`isServerError |> ${serverError}`, () => { |
131 | 132 | expect(isServerError(status)).toEqual(serverError); |
132 | 133 | }); |
133 | 134 | }); |
134 | 135 | } |
135 | 136 | ); |
| 137 | + |
| 138 | +describe('[Method]', () => { |
| 139 | + it('Should contain all the HTTP methods', () => { |
| 140 | + expect(Method).toMatchInlineSnapshot(` |
| 141 | + Object { |
| 142 | + "CONNECT": "CONNECT", |
| 143 | + "DELETE": "DELETE", |
| 144 | + "GET": "GET", |
| 145 | + "HEAD": "HEAD", |
| 146 | + "OPTIONS": "OPTIONS", |
| 147 | + "PATCH": "PATCH", |
| 148 | + "POST": "POST", |
| 149 | + "PUT": "PUT", |
| 150 | + "TRACE": "TRACE", |
| 151 | + } |
| 152 | + `); |
| 153 | + }); |
| 154 | +}); |
0 commit comments