2

I am having issues writing Jest tests with Arangodb. This is the code I am running without including the import statements.

describe('Word store', () => {
  it('should return an object', () => {
    // Arrange
    const dataSource = new Database(uri);
    dataSource.useBasicAuth(user, password);
    dataSource.useDatabase(database);

    // Act
    const store = new Store(dataSource);

    // Assert
    expect(store).toMatchObject({
      get: expect.any(Function)
    });
  });
});

When executing the Jest tests, I get the following error message I have tried doing npm install --save request or npm install --save linkedlist.

Test suite failed to run Cannot find module 'linkedlist' from 'request.node.js' at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17) at Object. (node_modules/arangojs/lib/util/request.node.js:92:19)

It will be great if anyone might be able to offer some advice about writing Jest with ArangoDB correctly.

Thanks

1 Answer 1

-1

It looks like if I were to debug Jest it works, it might have to do with something about request.node.js.

Further testing showed that I was able to start the project fresh and get Jest to work with Arangodb. It might be a case of node_modules having a version conflict somewhere

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.