aicore / aicore/libmysql

Mockable functional apis for uni tests

Open
#154 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
2
Forks
1
Avg merge
8m
Merged PRs (30d)
2

Description

There should be a way to simulate mockable APIs with ram stored documents.

We could do something like this:

It might be better to have first-party mock support integrated into the source. For Eg. when initing we could give init(...mockDBMode=true) and the mocks will kick in and can use the simulated in-memory db for unit tests without any code code changes for tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading test/unit/utils/sync-test.spec.js, especially the put and getFromIndex examples linked in the issue, and inspect the init entry point in the library. Define the mock database behavior and integration boundaries before implementing it; done means unit tests can use ram-backed documents through the proposed mock mode without test-specific code changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
databases, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.