Skip to content

Commit d169712

Browse files
committed
Add primary key change to tests
1 parent a4bf5fa commit d169712

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1989,9 +1989,9 @@ t('subscribe', { timeout: 2 }, async() => {
19891989

19901990
const result = []
19911991

1992-
const { unsubscribe } = await sql.subscribe('*', (row, { command, old }) =>
1993-
result.push(command, row.name || row.id, old && old.name)
1994-
)
1992+
const { unsubscribe } = await sql.subscribe('*', (row, { command, old }) => {
1993+
result.push(command, row.name, row.id, old && old.name, old && old.id)
1994+
})
19951995

19961996
await sql`
19971997
create table test (
@@ -2003,6 +2003,7 @@ t('subscribe', { timeout: 2 }, async() => {
20032003
await sql`alter table test replica identity default`
20042004
await sql`insert into test (name) values ('Murray')`
20052005
await sql`update test set name = 'Rothbard'`
2006+
await sql`update test set id = 2`
20062007
await sql`delete from test`
20072008
await sql`alter table test replica identity full`
20082009
await sql`insert into test (name) values ('Murray')`
@@ -2013,7 +2014,7 @@ t('subscribe', { timeout: 2 }, async() => {
20132014
await sql`insert into test (name) values ('Oh noes')`
20142015
await delay(10)
20152016
return [
2016-
'insert,Murray,,update,Rothbard,,delete,1,,insert,Murray,,update,Rothbard,Murray,delete,Rothbard,',
2017+
'insert,Murray,1,,,update,Rothbard,1,,,update,Rothbard,2,,1,delete,,2,,,insert,Murray,2,,,update,Rothbard,2,Murray,2,delete,Rothbard,2,,',
20172018
result.join(','),
20182019
await sql`drop table test`,
20192020
await sql`drop publication alltables`,

0 commit comments

Comments
 (0)