11import * as R from "ramda" ;
2- import { isMethod , methods , Method , AuxMethod } from "../src/method" ;
2+ import {
3+ isMethod ,
4+ methods ,
5+ Method ,
6+ AuxMethod ,
7+ clientMethods ,
8+ ClientMethod ,
9+ } from "../src/method" ;
10+ import { describe } from "node:test" ;
311
412describe ( "Method" , ( ) => {
513 describe ( "methods array" , ( ) => {
@@ -8,6 +16,19 @@ describe("Method", () => {
816 } ) ;
917 } ) ;
1018
19+ describe ( "clientMethods array" , ( ) => {
20+ test ( "should be same methods and the head" , ( ) => {
21+ expect ( clientMethods ) . toEqual ( [
22+ "get" ,
23+ "post" ,
24+ "put" ,
25+ "delete" ,
26+ "patch" ,
27+ "head" ,
28+ ] ) ;
29+ } ) ;
30+ } ) ;
31+
1132 describe ( "the type" , ( ) => {
1233 test ( "should match the entries of the methods array" , ( ) => {
1334 expectTypeOf < "get" > ( ) . toExtend < Method > ( ) ;
@@ -19,6 +40,18 @@ describe("Method", () => {
1940 } ) ;
2041 } ) ;
2142
43+ describe ( "ClientMethod type" , ( ) => {
44+ test ( "should match the entries of the methods array" , ( ) => {
45+ expectTypeOf < "get" > ( ) . toExtend < ClientMethod > ( ) ;
46+ expectTypeOf < "post" > ( ) . toExtend < ClientMethod > ( ) ;
47+ expectTypeOf < "put" > ( ) . toExtend < ClientMethod > ( ) ;
48+ expectTypeOf < "delete" > ( ) . toExtend < ClientMethod > ( ) ;
49+ expectTypeOf < "patch" > ( ) . toExtend < ClientMethod > ( ) ;
50+ expectTypeOf < "head" > ( ) . toExtend < ClientMethod > ( ) ;
51+ expectTypeOf < "wrong" > ( ) . not . toExtend < ClientMethod > ( ) ;
52+ } ) ;
53+ } ) ;
54+
2255 describe ( "AuxMethod" , ( ) => {
2356 test ( "should be options or head" , ( ) => {
2457 expectTypeOf < "options" > ( ) . toExtend < AuxMethod > ( ) ;
0 commit comments