From b236bdafd89ca75bb652008b83086cff02cadbd2 Mon Sep 17 00:00:00 2001 From: Iliyas Date: Mon, 20 Mar 2023 11:33:10 +0600 Subject: [PATCH] Fixed deprecation warnings Signed-off-by: Iliyas --- CHANGELOG.md | 1 + test/unit/helpers/bulk.test.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a47e5795c..404c2fdc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove test artifacts from gh_pages workflow ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) - Make fields in `BulkOperation` optional to match OpenSearch Bulk API requirements ([#378](https://github.com/opensearch-project/opensearch-js/pull/378)) ### Deprecated +- Remove deprecation warnings in bulk.test.js ([#434](https://github.com/opensearch-project/opensearch-js/issues/434)) ### Removed - Remove waitCluster in Integration Tests ([#422](https://github.com/opensearch-project/opensearch-js/issues/422)) ### Fixed diff --git a/test/unit/helpers/bulk.test.js b/test/unit/helpers/bulk.test.js index 77558879b..f0d375e44 100644 --- a/test/unit/helpers/bulk.test.js +++ b/test/unit/helpers/bulk.test.js @@ -1051,11 +1051,11 @@ test('bulk update', (t) => { let count = 0; const MockConnection = connection.buildMockConnection({ onRequest(params) { - t.strictEqual(params.path, '/_bulk'); + t.equal(params.path, '/_bulk'); t.match(params.headers, { 'content-type': 'application/x-ndjson' }); const [action, payload] = params.body.split('\n'); - t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } }); - t.deepEqual(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true }); + t.same(JSON.parse(action), { update: { _index: 'test', _id: count } }); + t.same(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true }); return { body: { errors: false, items: [{ update: { result: 'noop' } }] } }; }, }); @@ -1465,13 +1465,13 @@ test('Flush interval', (t) => { let count = 0; const MockConnection = connection.buildMockConnection({ onRequest(params) { - t.strictEqual(params.path, '/_bulk'); + t.equal(params.path, '/_bulk'); t.match(params.headers, { 'content-type': 'application/x-ndjson', }); const [action, payload] = params.body.split('\n'); - t.deepEqual(JSON.parse(action), { index: { _index: 'test' } }); - t.deepEqual(JSON.parse(payload), dataset[count++]); + t.same(JSON.parse(action), { index: { _index: 'test' } }); + t.same(JSON.parse(payload), dataset[count++]); return { body: { errors: false, items: [{}] } }; }, });