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

chore: add types for the configuration #482

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

forivall
Copy link
Contributor

@forivall forivall commented Dec 6, 2024

This defines types for the config file, which can help when modifying the config file, as you can use a jsdoc type annotation to define the type and get some editor hints for the configuration options.

jest-mongodb-config.js

/** @type {import('@shelf/jest-mongodb').Config} */
module.exports = {
  mongodbMemoryServerOptions: {
    binary: {
      version: '4.0.3',
      skipMD5: true,
    },
    autoStart: false,
    instance: {},
  },
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds type definitions for the configuration used by Jest MongoDB setups to improve editor support through JSDoc annotations.

  • Added type definitions in src/types.ts for various Mongo memory server options and the overall Config interface.
  • Updated Jest MongoDB configuration files to include JSDoc type annotations.
  • Modified helper functions to utilize the newly defined Config type when loading configuration.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/types.ts Added type definitions to support configuration types.
jest-mongodb-config.js Added JSDoc type annotation for Config on config export.
src/helpers.ts Updated require calls to use Config type annotations.
jest-mongodb-config-repl.js Added JSDoc type annotation for Config on config export.
@vladholubiev vladholubiev merged commit 5ffb853 into shelfio:master Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants