Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for mocking library #1545

Merged
merged 3 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Update mock lib
  • Loading branch information
delvedor committed Aug 30, 2021
commit e23e7cfc494bc43fbdd7526691fde299f87c0fe9
48 changes: 0 additions & 48 deletions test/mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,6 @@ test('Mock should work', async t => {
Connection: mock.getConnection()
})

// TODO: remove this once https://github.com/elastic/elasticsearch-js-mock/pull/20 lands
mock.add({
method: 'GET',
path: '/'
}, () => {
return {
name: '1ef419078577',
cluster_name: 'docker-cluster',
cluster_uuid: 'cQ5pAMvRRTyEzObH4L5mTA',
version: {
number: '7.13.0-SNAPSHOT',
build_flavor: 'default',
build_type: 'docker',
build_hash: '5fb4c050958a6b0b6a70a6fb3e616d0e390eaac3',
build_date: '2021-07-10T01:45:02.136546168Z',
build_snapshot: true,
lucene_version: '8.9.0',
minimum_wire_compatibility_version: '7.15.0',
minimum_index_compatibility_version: '7.0.0'
},
tagline: 'You Know, for Search'
}
})

mock.add({
method: 'GET',
path: '/_cat/indices'
Expand All @@ -76,30 +52,6 @@ test('Return an error', async t => {
Connection: mock.getConnection()
})

// TODO: remove this once https://github.com/elastic/elasticsearch-js-mock/pull/20 lands
mock.add({
method: 'GET',
path: '/'
}, () => {
return {
name: '1ef419078577',
cluster_name: 'docker-cluster',
cluster_uuid: 'cQ5pAMvRRTyEzObH4L5mTA',
version: {
number: '7.13.0-SNAPSHOT',
build_flavor: 'default',
build_type: 'docker',
build_hash: '5fb4c050958a6b0b6a70a6fb3e616d0e390eaac3',
build_date: '2021-07-10T01:45:02.136546168Z',
build_snapshot: true,
lucene_version: '8.9.0',
minimum_wire_compatibility_version: '7.15.0',
minimum_index_compatibility_version: '7.0.0'
},
tagline: 'You Know, for Search'
}
})

mock.add({
method: 'GET',
path: '/_cat/indices'
Expand Down
2 changes: 1 addition & 1 deletion test/mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "ISC",
"dependencies": {
"@elastic/elasticsearch": "file:../..",
"@elastic/elasticsearch-mock": "^0.3.0",
"@elastic/elasticsearch-mock": "^0.3.1",
"standard": "^16.0.3",
"tap": "^15.0.9"
}
Expand Down