Skip to content

Commit

Permalink
Merge latest from main
Browse files Browse the repository at this point in the history
  • Loading branch information
flevi29 committed Jan 8, 2024
2 parents 3a9f9e6 + be57d84 commit c808d06
Show file tree
Hide file tree
Showing 11 changed files with 2,030 additions and 2,774 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ examples
scripts
tests/env
coverage
/jest-disable-built-in-fetch.js
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
'jest/no-jasmine-globals': 'off',
'jest/valid-expect-in-promise': 'off',
'jest/valid-expect': 'off',
'jest/no-alias-methods': 'off',
},
},
],
Expand Down
5 changes: 5 additions & 0 deletions jest-disable-built-in-fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function () {
// This is required for tests to work with "cross-fetch" on newer node versions,
// otherwise "cross-fetch" won't replace the builtin `fetch`
globalThis.fetch = undefined
}
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// eslint-disable-next-line tsdoc/syntax
/** @type {import('jest').Config} */
const config = {
rootDir: '.',
testMatch: ['<rootDir>/tests/**/*.ts?(x)'],
Expand All @@ -15,6 +17,7 @@ const config = {
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
globalSetup: './jest-disable-built-in-fetch.js',
projects: [
{
preset: 'ts-jest',
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,20 @@
"@rollup/plugin-commonjs": "25.0.2",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "15.1.0",
"@types/jest": "^27.5.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"abort-controller": "^3.0.0",
"brotli-size": "^4.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-jest": "^27.6.1",
"eslint-plugin-tsdoc": "^0.2.17",
"gzip-size": "^6.0.0",
"jest": "^26.6.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jest-watch-typeahead": "^0.6.3",
"jest-watch-typeahead": "^2.2.2",
"kleur": "^4.1.5",
"lint-staged": "11.1.2",
"nodemon": "^2.0.16",
Expand All @@ -104,7 +105,7 @@
"rollup-plugin-terser": "^7.0.0",
"rollup-plugin-typescript2": "^0.35.0",
"shx": "^0.3.2",
"ts-jest": "^26.5.6",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
}
}
96 changes: 48 additions & 48 deletions tests/__snapshots__/facet_search.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Test on POST search Admin key: basic facet value search 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Expand All @@ -18,9 +18,9 @@ Object {
`;

exports[`Test on POST search Admin key: facet value search with filter 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Expand All @@ -31,21 +31,21 @@ Object {
`;

exports[`Test on POST search Admin key: facet value search with no facet query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Object {
{
"count": 1,
"value": "comedy",
},
Object {
{
"count": 2,
"value": "romance",
},
Expand All @@ -56,9 +56,9 @@ Object {
`;

exports[`Test on POST search Admin key: facet value search with search query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "adventure",
},
Expand All @@ -69,13 +69,13 @@ Object {
`;

exports[`Test on POST search Master key: basic facet value search 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Expand All @@ -86,9 +86,9 @@ Object {
`;

exports[`Test on POST search Master key: facet value search with filter 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Expand All @@ -99,21 +99,21 @@ Object {
`;

exports[`Test on POST search Master key: facet value search with no facet query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Object {
{
"count": 1,
"value": "comedy",
},
Object {
{
"count": 2,
"value": "romance",
},
Expand All @@ -124,9 +124,9 @@ Object {
`;

exports[`Test on POST search Master key: facet value search with search query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "adventure",
},
Expand All @@ -137,13 +137,13 @@ Object {
`;

exports[`Test on POST search Search key: basic facet value search 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Expand All @@ -154,9 +154,9 @@ Object {
`;

exports[`Test on POST search Search key: facet value search with filter 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Expand All @@ -167,21 +167,21 @@ Object {
`;

exports[`Test on POST search Search key: facet value search with no facet query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "action",
},
Object {
{
"count": 2,
"value": "adventure",
},
Object {
{
"count": 1,
"value": "comedy",
},
Object {
{
"count": 2,
"value": "romance",
},
Expand All @@ -192,9 +192,9 @@ Object {
`;

exports[`Test on POST search Search key: facet value search with search query 1`] = `
Object {
"facetHits": Array [
Object {
{
"facetHits": [
{
"count": 1,
"value": "adventure",
},
Expand Down
32 changes: 16 additions & 16 deletions tests/__snapshots__/faceting.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Test on faceting Admin key: Get default faceting object 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Admin key: Reset faceting 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Admin key: Update faceting at null 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Admin key: Update faceting settings 1`] = `
Object {
{
"maxValuesPerFacet": 12,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
"test": "count",
},
}
`;

exports[`Test on faceting Master key: Get default faceting object 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Master key: Reset faceting 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Master key: Update faceting at null 1`] = `
Object {
{
"maxValuesPerFacet": 100,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
},
}
`;

exports[`Test on faceting Master key: Update faceting settings 1`] = `
Object {
{
"maxValuesPerFacet": 12,
"sortFacetValuesBy": Object {
"sortFacetValuesBy": {
"*": "alpha",
"test": "count",
},
Expand Down
Loading

0 comments on commit c808d06

Please sign in to comment.