@@ -5,7 +5,7 @@ import EtaHooked, { type EtaHookedConfig } from "../src/index.ts";
55
66const FIXTURES_DIR = join ( __dirname , "__fixtures__" ) ;
77
8- const mockTransformer = ( content : string , filename : string ) => {
8+ const mockTransform = ( content : string , filename : string ) => {
99 if ( filename . toLocaleLowerCase ( ) . endsWith ( ".md" ) ) {
1010 return `<div>${ content . trim ( ) } </div>` ;
1111 }
@@ -16,7 +16,7 @@ describe("Unit Tests", () => {
1616 let etaHooked : EtaHooked ;
1717
1818 beforeEach ( ( ) => {
19- etaHooked = new EtaHooked ( { transformer : mockTransformer } ) ;
19+ etaHooked = new EtaHooked ( { transform : mockTransform } ) ;
2020 } ) ;
2121
2222 afterEach ( ( ) => {
@@ -25,16 +25,16 @@ describe("Unit Tests", () => {
2525
2626 describe ( "constructor" , ( ) => {
2727 it ( "should initialize with default config" , ( ) => {
28- expect ( etaHooked . transformer ) . toBeDefined ( ) ;
28+ expect ( etaHooked . transform ) . toBeDefined ( ) ;
2929 expect ( etaHooked . config ) . toBeDefined ( ) ;
3030 } ) ;
3131
32- it ( "should initialize with custom transformer " , ( ) => {
32+ it ( "should initialize with custom transform " , ( ) => {
3333 const config : Partial < EtaHookedConfig > = {
34- transformer : mockTransformer ,
34+ transform : mockTransform ,
3535 } ;
3636 etaHooked = new EtaHooked ( config ) ;
37- expect ( etaHooked . transformer ) . toBe ( mockTransformer ) ;
37+ expect ( etaHooked . transform ) . toBe ( mockTransform ) ;
3838 } ) ;
3939
4040 it ( "should initialize with custom eta config" , ( ) => {
@@ -47,12 +47,12 @@ describe("Unit Tests", () => {
4747 } ) ;
4848
4949 describe ( "readFile" , ( ) => {
50- it ( "should read raw content without transformer " , ( ) => {
50+ it ( "should read raw content without transform " , ( ) => {
5151 const result = etaHooked . readFile ( join ( FIXTURES_DIR , "simple.html" ) ) ;
5252 expect ( result ) . toContain ( "<h1>Title</h1>" ) ;
5353 } ) ;
5454
55- it ( "should handle template with transformer " , ( ) => {
55+ it ( "should handle template with transform " , ( ) => {
5656 const result = etaHooked . readFile ( join ( FIXTURES_DIR , "simple.md" ) ) ;
5757 expect ( result ) . toContain ( "<div># Hello</div>" ) ;
5858 } ) ;
0 commit comments