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
38 changes: 0 additions & 38 deletions test/integration/bson-decimal128/decimal128.test.js

This file was deleted.

31 changes: 31 additions & 0 deletions test/integration/bson-decimal128/decimal128.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { expect } from 'chai';

import { type Collection, Decimal128, type MongoClient } from '../../../src';

describe('Decimal128', function () {
let client: MongoClient;
let collection: Collection;

beforeEach(async function () {
client = this.configuration.newClient();
collection = client.db('decimal128').collection('decimal128');
});

afterEach(async function () {
await client.close();
});

it('should correctly insert decimal128 value', async function () {
const object = {
id: 1,
value: Decimal128.fromString('1.28')
};
await collection.insertOne(object);
const doc = await collection.findOne({
id: 1
});

expect(doc.value).to.be.instanceof(Decimal128);
expect(doc.value.toString()).to.equal('1.28');
});
});