Skip to content

Commit

Permalink
Sign-off-by: Iliyas <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikmeister committed Mar 22, 2023
1 parent 7faaf40 commit 7d9eaa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions test/unit/helpers/bulk.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } }] } };
},
});
Expand Down Expand Up @@ -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: [{}] } };
},
});
Expand Down

0 comments on commit 7d9eaa8

Please sign in to comment.