diff --git a/packages/cli-repl/test/e2e-bson.spec.ts b/packages/cli-repl/test/e2e-bson.spec.ts index b01c300b3e..ea3c255922 100644 --- a/packages/cli-repl/test/e2e-bson.spec.ts +++ b/packages/cli-repl/test/e2e-bson.spec.ts @@ -46,7 +46,7 @@ describe('BSON e2e', function() { Timestamp: 'Timestamp(1, 100)', Symbol: 'abc', Code: 'Code("abc")', - NumberDecimal: 'Decimal128("1")', + NumberDecimal: 'Decimal128.fromString("1")', BinData: 'Binary(Buffer.from("31323334", "hex"), 128)' }; it('Entire doc prints when returned from the server', async() => { @@ -172,7 +172,7 @@ describe('BSON e2e', function() { await db.collection('test').insertOne({ value: value }); await shell.writeInputLine('db.test.findOne().value'); await eventually(() => { - shell.assertContainsOutput('Decimal128("1")'); + shell.assertContainsOutput('Decimal128.fromString("1")'); }); shell.assertNoErrors(); }); @@ -279,7 +279,7 @@ describe('BSON e2e', function() { const value = 'NumberDecimal("100")'; await shell.writeInputLine(value); await eventually(() => { - shell.assertContainsOutput('Decimal128("100")'); + shell.assertContainsOutput('Decimal128.fromString("100")'); }); shell.assertNoErrors(); }); diff --git a/packages/service-provider-core/src/printable-bson.spec.ts b/packages/service-provider-core/src/printable-bson.spec.ts index 4fcf234047..da959df1c6 100644 --- a/packages/service-provider-core/src/printable-bson.spec.ts +++ b/packages/service-provider-core/src/printable-bson.spec.ts @@ -32,7 +32,7 @@ describe('BSON printers', function() { }); it('formats NumberDecimal correctly', function() { - expect(inspect(bson.Decimal128.fromString('1'))).to.equal('Decimal128("1")'); + expect(inspect(bson.Decimal128.fromString('1'))).to.equal('Decimal128.fromString("1")'); }); it('formats Timestamp correctly', function() { diff --git a/packages/service-provider-core/src/printable-bson.ts b/packages/service-provider-core/src/printable-bson.ts index 41b856debf..cb5ae9a059 100644 --- a/packages/service-provider-core/src/printable-bson.ts +++ b/packages/service-provider-core/src/printable-bson.ts @@ -37,7 +37,7 @@ export const bsonStringifiers: Record string> = { }, Decimal128: function(): string { - return `Decimal128("${this.toString()}")`; + return `Decimal128.fromString("${this.toString()}")`; }, Int32: function(): string {