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

Update Jest #1622

Merged
merged 2 commits into from
Jan 8, 2024
Merged

Update Jest #1622

merged 2 commits into from
Jan 8, 2024

Conversation

flevi29
Copy link
Collaborator

@flevi29 flevi29 commented Jan 6, 2024

Pull Request

Related issue

Fixes #1621

What does this PR do?

  • because newer versions of jest doesn't include anymore "jest-environment-jsdom", add it as development dependency
  • because newer versions of jest simplified snapshots, update them accordingly
    • this means replacing Object { with { and Array [ with [
  • because newer versions of jest support builtin fetch from newer versions of Node.js, add a global setup script that disables builtin fetch
  • jasmine fail() doesn't work anymore, but it still fails the tests, except with a less convenient error message ReferenceError: fail is not defined https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults EDIT: just realized it says here that we can set "testRunner": "jest-jasmine2", but I tried it and fail() is still undefined
    • should fix this in a separate PR, where we fix/improve the tests, this PR is about updating Jest and making minimal code changes for it to work

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@flevi29 flevi29 mentioned this pull request Jan 8, 2024
3 tasks
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

Hello @flevi29

Can you fix the style-check test so that we can merge it?

https://github.com/meilisearch/meilisearch-js/actions/runs/7431299916?pr=1622

@curquiza curquiza added the maintenance Issue about maintenance (CI, tests, refacto...) label Jan 8, 2024
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c869e53) 97.45% compared to head (8950f26) 97.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1622   +/-   ##
=======================================
  Coverage   97.45%   97.45%           
=======================================
  Files          22       22           
  Lines         826      826           
  Branches      109      109           
=======================================
  Hits          805      805           
  Misses         20       20           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

molto bene!

bors merge

Copy link
Contributor

meili-bors bot commented Jan 8, 2024

@meili-bors meili-bors bot merged commit be57d84 into meilisearch:main Jan 8, 2024
8 checks passed
@flevi29 flevi29 deleted the update-jest branch January 8, 2024 12:06
meili-bors bot added a commit that referenced this pull request Jan 15, 2024
1625: Update version for the next release (v0.37.0) r=brunoocasali a=meili-bot

_This PR is auto-generated._

The automated script updates the version of meilisearch-js to a new version: "v0.37.0"

👇 Changelogs
---

## 🚀 Enhancements

* Add support for the new setting: `proximityPrecision` (#1619) mdubus
```js
client.index('books').getProximityPrecision()
client.index('books').updateProximityPrecision('byAttribute')
client.index('books').resetProximityPrecision()
```
* Update error inheritance to extend `MeiliSearchError` (#1607) amit-ksh

## 🧪 Experimental enhancement - Hybrid and vector search

⚠️ This is about an experimental feature of Meilisearch. Activate the [`vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features)

* Add support for the `embedders` settings (#1623) mdubus
```js
client.index('books').getEmbedders()
client.index('books').updateEmbedders({ default: { source: 'userProvided', dimensions: 1 }})
client.index('books').resetEmbedders()
```

* Add support for the `hybrid` parameter during search (#1623) mdubus

## ⚙️ Maintenance/misc

* Fix test name in error.test.ts (#1609) amit-ksh
* Update Jest (#1622) flevi29

Thanks again to amit-ksh, flevi29! 🎉


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
meili-bors bot added a commit that referenced this pull request Oct 3, 2024
1611: Add `package.json` `"exports"` field r=curquiza a=flevi29

# Pull Request

I am aiming to slowly try to update and simplify this repository, and maybe learn a thing or two along the way.

## What does this PR do?
- add `"exports"` field to `package.json`
  - It is the new way of defining your exported files, instead of just relying on one single [`"main"`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#main) export for Node.js
  - This way Node.js can conditionally determine which exported file to import based on the fact that `require` or `import` was used, previously Node.js even in ESM mode always imported the commonjs version of this package, but now it can import the ESM version
  - https://webpack.js.org/guides/package-exports/
  - [subpath-exports](https://nodejs.org/docs/latest-v20.x/api/packages.html#subpath-exports)
  - [conditional-exports](https://nodejs.org/docs/latest-v20.x/api/packages.html#conditional-exports)
- add `node:` specifiers to Node.js built-in module imports/requires
- add missing ``@types/node`` type definitions development dependency
- because older versions of `jest` test runner doesn't support `node:` specifiers, update `jest` (#1622)
- ~~because newer versions of `jest` doesn't include anymore `"jest-environment-jsdom"`, add it as development dependency~~
- ~~because newer versions of `jest` simplified snapshots, update them accordingly~~
  - ~~this means replacing `Object {` with `{` and `Array [` with `[`~~

> [!CAUTION]
> This is a breaking change for anyone who was importing anything other than what we have in the `"exports"` package.json field. From now on only files from the `package.json` `"exports"` field can be imported.

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: F. Levi <55688616+flevi29@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Issue about maintenance (CI, tests, refacto...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Jest
2 participants