Comparing version 40.2.0 to 40.2.1
@@ -33,2 +33,28 @@ "use strict"; | ||
const createIntegrationTests = (test, driverFactory) => { | ||
test('streams data', async (t) => { | ||
const pool = await (0, __1.createPool)(t.context.dsn, { | ||
driverFactory, | ||
maximumPoolSize: 1, | ||
}); | ||
const onData = sinon.spy(); | ||
await Promise.all([ | ||
pool.stream(__1.sql.unsafe `SELECT * FROM (VALUES (1), (2)) as t(id)`, (stream) => { | ||
stream.on('data', onData); | ||
}), | ||
]); | ||
t.true(onData.calledTwice); | ||
t.deepEqual(onData.firstCall.args, [ | ||
{ | ||
data: { | ||
id: 1, | ||
}, | ||
fields: [ | ||
{ | ||
dataTypeId: 23, | ||
name: 'id', | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
test('inserts and retrieves bigint', async (t) => { | ||
@@ -35,0 +61,0 @@ const pool = await (0, __1.createPool)(t.context.dsn, { |
@@ -97,3 +97,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "40.2.0" | ||
"version": "40.2.1" | ||
} |
@@ -34,2 +34,36 @@ /* eslint-disable id-length */ | ||
) => { | ||
test('streams data', async (t) => { | ||
const pool = await createPool(t.context.dsn, { | ||
driverFactory, | ||
maximumPoolSize: 1, | ||
}); | ||
const onData = sinon.spy(); | ||
await Promise.all([ | ||
pool.stream( | ||
sql.unsafe`SELECT * FROM (VALUES (1), (2)) as t(id)`, | ||
(stream) => { | ||
stream.on('data', onData); | ||
}, | ||
), | ||
]); | ||
t.true(onData.calledTwice); | ||
t.deepEqual(onData.firstCall.args, [ | ||
{ | ||
data: { | ||
id: 1, | ||
}, | ||
fields: [ | ||
{ | ||
dataTypeId: 23, | ||
name: 'id', | ||
}, | ||
], | ||
}, | ||
]); | ||
}); | ||
test('inserts and retrieves bigint', async (t) => { | ||
@@ -36,0 +70,0 @@ const pool = await createPool(t.context.dsn, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1059636
18565