@@ -3,13 +3,13 @@ import { Elysia } from "elysia";
33import { csrf } from "./src/index" ;
44
55describe ( "Elysia CSRF Plugin" , ( ) => {
6- test ( "should initialize plugin correctly" , ( ) => {
6+ test . only ( "should initialize plugin correctly" , ( ) => {
77 expect ( ( ) => {
88 new Elysia ( ) . use ( csrf ( { cookie : true } ) ) ;
99 } ) . not . toThrow ( ) ;
1010 } ) ;
1111
12- test ( "should generate token and set cookie" , async ( ) => {
12+ test . only ( "should generate token and set cookie" , async ( ) => {
1313 const app = new Elysia ( )
1414 . use (
1515 csrf ( {
@@ -32,7 +32,7 @@ describe("Elysia CSRF Plugin", () => {
3232 expect ( cookies ) . toContain ( "_csrf" ) ;
3333 } ) ;
3434
35- test ( "should reject POST without token" , async ( ) => {
35+ test . only ( "should reject POST without token" , async ( ) => {
3636 const app = new Elysia ( )
3737 . use ( csrf ( { cookie : true } ) )
3838 . get ( "/token" , ( { csrfToken } ) => ( { token : csrfToken ( ) } ) )
@@ -55,7 +55,7 @@ describe("Elysia CSRF Plugin", () => {
5555 expect ( failRes . status ) . toBe ( 403 ) ;
5656 } ) ;
5757
58- test ( "should reject POST with invalid token" , async ( ) => {
58+ test . only ( "should reject POST with invalid token" , async ( ) => {
5959 const app = new Elysia ( )
6060 . use ( csrf ( { cookie : true } ) )
6161 . get ( "/token" , ( { csrfToken } ) => ( { token : csrfToken ( ) } ) )
@@ -362,7 +362,7 @@ describe("Elysia CSRF Plugin", () => {
362362 expect ( apiRes . status ) . toBe ( 200 ) ;
363363 } ) ;
364364
365- test ( "should skip validation for safe methods" , async ( ) => {
365+ test . only ( "should skip validation for safe methods" , async ( ) => {
366366 const app = new Elysia ( )
367367 . use ( csrf ( { cookie : true } ) )
368368 . get ( "/safe" , ( ) => ( { message : "GET is safe" } ) )
0 commit comments