Skip to content

Commit 971a65c

Browse files
add debug information
1 parent b907f4d commit 971a65c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.evergreen/install-mongodb-client-encryption.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -o xtrace # Write all commands first to stderr
1010
set -o errexit # Exit the script with error if any of the commands fail
1111

1212
rm -rf mongodb-client-encryption
13-
git clone https://github.com/mongodb-js/mongodb-client-encryption.git
13+
git clone https://github.com/mongodb-js/mongodb-client-encryption.git -b explicit-lifetime-chaining
1414
pushd mongodb-client-encryption
1515

1616
if [ -n "${LIBMONGOCRYPT_VERSION}" ]; then

test/integration/node-specific/bson-options/utf8_validation.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { expect } from 'chai';
22
import * as net from 'net';
33
import * as sinon from 'sinon';
4+
import { inspect } from 'util';
45

56
import {
67
BSON,
78
BSONError,
89
type Collection,
10+
deserialize,
911
type MongoClient,
1012
MongoDBResponse,
1113
MongoServerError,
@@ -173,7 +175,9 @@ describe('utf8 validation with cursors', function () {
173175

174176
if (providedBuffer.includes(targetBytes)) {
175177
if (providedBuffer.split(targetBytes).length !== 2) {
176-
throw new Error('received buffer more than one `c3a9` sequences. or perhaps none?');
178+
sinon.restore();
179+
const message = `expected exactly one c3a9 sequence, received ${providedBuffer.split(targetBytes).length}\n. command: ${inspect(deserialize(args[0]), { depth: Infinity })}`;
180+
throw new Error(message);
177181
}
178182
const buffer = Buffer.from(providedBuffer.replace('c3a9', 'c301'), 'hex');
179183
const result = stub.wrappedMethod.apply(this, [buffer]);

0 commit comments

Comments
 (0)