Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli-repl/test/e2e-bson.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() => {
Expand Down Expand Up @@ -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();
});
Expand Down Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion packages/service-provider-core/src/printable-bson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const bsonStringifiers: Record<string, (this: any) => string> = {
},

Decimal128: function(): string {
return `Decimal128("${this.toString()}")`;
return `Decimal128.fromString("${this.toString()}")`;
},

Int32: function(): string {
Expand Down