@@ -128,18 +128,18 @@ describe('sync lifecycle — run, checkpoint, resume', () => {
128128 it ( 'run 1: writes records and persists state' , async ( ) => {
129129 const engine = await createEngine ( makeResolver ( ) )
130130 const pipeline = {
131- source : { type : 'test' , test : { streams : { customers : { } } } } ,
131+ source : { type : 'test' , test : { streams : { customer : { } } } } ,
132132 destination : {
133133 type : 'postgres' ,
134134 postgres : { url : connectionString , schema : SCHEMA } ,
135135 } ,
136136 }
137137
138138 const input = [
139- record ( 'customers ' , 'cus_1' , { name : 'Alice' } ) ,
140- record ( 'customers ' , 'cus_2' , { name : 'Bob' } ) ,
141- record ( 'customers ' , 'cus_3' , { name : 'Charlie' } ) ,
142- state ( 'customers ' , { after : 'cus_3' } ) ,
139+ record ( 'customer ' , 'cus_1' , { name : 'Alice' } ) ,
140+ record ( 'customer ' , 'cus_2' , { name : 'Bob' } ) ,
141+ record ( 'customer ' , 'cus_3' , { name : 'Charlie' } ) ,
142+ state ( 'customer ' , { after : 'cus_3' } ) ,
143143 ]
144144
145145 // Set up destination schema/tables, then run pipeline
@@ -158,13 +158,13 @@ describe('sync lifecycle — run, checkpoint, resume', () => {
158158
159159 // Verify records were written
160160 const { rows : customers } = await pool . query (
161- `SELECT count(*)::int AS n FROM "${ SCHEMA } ".customers `
161+ `SELECT count(*)::int AS n FROM "${ SCHEMA } ".customer `
162162 )
163163 expect ( customers [ 0 ] . n ) . toBe ( 3 )
164164
165165 // Verify state was persisted
166166 const { rows : stateRows } = await pool . query (
167- `SELECT data FROM "${ SCHEMA } "."${ STATE_TABLE } " WHERE stream = 'customers '`
167+ `SELECT data FROM "${ SCHEMA } "."${ STATE_TABLE } " WHERE stream = 'customer '`
168168 )
169169 expect ( stateRows ) . toHaveLength ( 1 )
170170 expect ( stateRows [ 0 ] . data ) . toEqual ( { after : 'cus_3' } )
@@ -179,17 +179,17 @@ describe('sync lifecycle — run, checkpoint, resume', () => {
179179
180180 const engine = await createEngine ( makeResolver ( ) )
181181 const pipeline = {
182- source : { type : 'test' , test : { streams : { customers : { } } } } ,
182+ source : { type : 'test' , test : { streams : { customer : { } } } } ,
183183 destination : {
184184 type : 'postgres' ,
185185 postgres : { url : connectionString , schema : SCHEMA } ,
186186 } ,
187187 }
188188
189189 const input = [
190- record ( 'customers ' , 'cus_4' , { name : 'Diana' } ) ,
191- record ( 'customers ' , 'cus_5' , { name : 'Eve' } ) ,
192- state ( 'customers ' , { after : 'cus_5' } ) ,
190+ record ( 'customer ' , 'cus_4' , { name : 'Diana' } ) ,
191+ record ( 'customer ' , 'cus_5' , { name : 'Eve' } ) ,
192+ state ( 'customer ' , { after : 'cus_5' } ) ,
193193 ]
194194
195195 for await ( const msg of engine . pipeline_sync (
@@ -209,13 +209,13 @@ describe('sync lifecycle — run, checkpoint, resume', () => {
209209
210210 // Verify table now has 5 rows total (3 from run 1 + 2 from run 2)
211211 const { rows : customers } = await pool . query (
212- `SELECT count(*)::int AS n FROM "${ SCHEMA } ".customers `
212+ `SELECT count(*)::int AS n FROM "${ SCHEMA } ".customer `
213213 )
214214 expect ( customers [ 0 ] . n ) . toBe ( 5 )
215215
216216 // Verify state was updated
217217 const { rows : stateRows } = await pool . query (
218- `SELECT data FROM "${ SCHEMA } "."${ STATE_TABLE } " WHERE stream = 'customers '`
218+ `SELECT data FROM "${ SCHEMA } "."${ STATE_TABLE } " WHERE stream = 'customer '`
219219 )
220220 expect ( stateRows ) . toHaveLength ( 1 )
221221 expect ( stateRows [ 0 ] . data ) . toEqual ( { after : 'cus_5' } )
0 commit comments