Skip to content

How to use elastic-mock properly? #26

Closed
@Artem-Tsymbal

Description

@Artem-Tsymbal

"@elastic/elasticsearch": "^8.1.0",
"@elastic/elasticsearch-mock": "^2.0.0",
"jest": "^24.9.0",
Node: v12.22.7

image

console.log(mock.getConnection()) -> [class MockConnection extends BaseConnection]

console.error node_modules/jest-jasmine2/build/jasmine/Env.js:289
  Unhandled error

console.error node_modules/jest-jasmine2/build/jasmine/Env.js:290
  ResponseError: {"error":"Mock not found"}
      at SniffingTransport.request (.../node_modules/@elastic/transport/src/Transport.ts:532:17)
      at Indices.delete (.../node_modules/@elastic/elasticsearch/src/api/api/indices.ts:301:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions