11import { NextModeTagCache } from "@opennextjs/aws/types/overrides" ;
2- import { beforeEach , describe , expect , it , vi } from "vitest" ;
2+ import { beforeEach , describe , expect , it , vi } from "vitest" ;
33
4- import { softTagFilter , withFilter } from "./tag-cache-filter" ;
4+ import { softTagFilter , withFilter } from "./tag-cache-filter" ;
55
66const mockedTagCache = {
77 name : "mocked" ,
@@ -28,17 +28,17 @@ describe("withFilter", () => {
2828
2929 await tagCache . writeTags ( tags ) ;
3030 expect ( mockedTagCache . writeTags ) . toHaveBeenCalledWith ( [ "valid_tag" ] ) ;
31- } )
31+ } ) ;
3232
33- it ( ' should not call writeTags if no tags are valid' , async ( ) => {
33+ it ( " should not call writeTags if no tags are valid" , async ( ) => {
3434 const tagCache = withFilter ( {
3535 originalTagCache : mockedTagCache ,
3636 filterFn,
3737 } ) ;
3838 const tags = [ "invalid_tag" ] ;
3939 await tagCache . writeTags ( tags ) ;
4040 expect ( mockedTagCache . writeTags ) . not . toHaveBeenCalled ( ) ;
41- } )
41+ } ) ;
4242
4343 it ( "should filter out tags based on hasBeenRevalidated" , async ( ) => {
4444 const tagCache = withFilter ( {
@@ -51,10 +51,9 @@ describe("withFilter", () => {
5151
5252 await tagCache . hasBeenRevalidated ( tags , lastModified ) ;
5353 expect ( mockedTagCache . hasBeenRevalidated ) . toHaveBeenCalledWith ( [ "valid_tag" ] , lastModified ) ;
54- }
55- )
54+ } ) ;
5655
57- it ( ' should not call hasBeenRevalidated if no tags are valid' , async ( ) => {
56+ it ( " should not call hasBeenRevalidated if no tags are valid" , async ( ) => {
5857 const tagCache = withFilter ( {
5958 originalTagCache : mockedTagCache ,
6059 filterFn,
@@ -63,7 +62,7 @@ describe("withFilter", () => {
6362 const lastModified = Date . now ( ) ;
6463 await tagCache . hasBeenRevalidated ( tags , lastModified ) ;
6564 expect ( mockedTagCache . hasBeenRevalidated ) . not . toHaveBeenCalled ( ) ;
66- } )
65+ } ) ;
6766
6867 it ( "should filter out tags based on getPathsByTags" , async ( ) => {
6968 const tagCache = withFilter ( {
@@ -75,28 +74,26 @@ describe("withFilter", () => {
7574
7675 await tagCache . getPathsByTags ?.( tags ) ;
7776 expect ( mockedTagCache . getPathsByTags ) . toHaveBeenCalledWith ( [ "valid_tag" ] ) ;
78- }
79- )
77+ } ) ;
8078
81- it ( ' should not call getPathsByTags if no tags are valid' , async ( ) => {
79+ it ( " should not call getPathsByTags if no tags are valid" , async ( ) => {
8280 const tagCache = withFilter ( {
8381 originalTagCache : mockedTagCache ,
8482 filterFn,
8583 } ) ;
8684 const tags = [ "invalid_tag" ] ;
8785 await tagCache . getPathsByTags ?.( tags ) ;
8886 expect ( mockedTagCache . getPathsByTags ) . not . toHaveBeenCalled ( ) ;
89- } )
87+ } ) ;
9088
91- it ( ' should return the correct name' , ( ) => {
89+ it ( " should return the correct name" , ( ) => {
9290 const tagCache = withFilter ( {
9391 originalTagCache : mockedTagCache ,
9492 filterFn,
9593 } ) ;
9694
97- expect ( tagCache . name ) . toBe ( 'filtered-mocked' ) ;
98- }
99- )
95+ expect ( tagCache . name ) . toBe ( "filtered-mocked" ) ;
96+ } ) ;
10097
10198 it ( "should not create a function if getPathsByTags is not defined" , async ( ) => {
10299 const tagCache = withFilter ( {
@@ -108,8 +105,7 @@ describe("withFilter", () => {
108105 } ) ;
109106
110107 expect ( tagCache . getPathsByTags ) . toBeUndefined ( ) ;
111- }
112- )
108+ } ) ;
113109
114110 it ( "should properly filter soft tags" , ( ) => {
115111 const tagCache = withFilter ( {
@@ -119,5 +115,5 @@ describe("withFilter", () => {
119115
120116 tagCache . writeTags ( [ "valid_tag" , "_N_T_/" , "_N_T_/test" , "_N_T_/layout" ] ) ;
121117 expect ( mockedTagCache . writeTags ) . toHaveBeenCalledWith ( [ "valid_tag" ] ) ;
122- } )
123- } ) ;
118+ } ) ;
119+ } ) ;
0 commit comments