Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

REVIEW: Jayne’s Non-fiction reading list

Astronomers’ Library by Karen Masters

Indulge in this collection of the best astronomy books from the past 800 years. The Astronomers’ Library is a rich history of astronomy (and astrology) publishing across Europe.

This is a carefully selected arrangement of publications from all over the continent – Germany, France, Italy, Netherlands, Spain, and the UK. And of course, as the original world leader in astrology, the middle east is featured, with multiple books from Persia.

Humankind has looked to the heavens since the dawn of time, wondering what is out there, as well as how everything works and (originally) who was responsible for it. Every tribe, race and civilization has wondered about our place in the universe and what lies beyond and what lies within it, below our feet.

Lately, attention has turned to the origins of the universe. From the turn of the millennium, knowledge and ideas were recorded, first on tablets or rock, then in the form of simple manuscripts, and eventually in a much more elaborate fashion as illustrative and engraving skills evolved.

The advent of printed books saw the production of highly illustrated tomes that showed off the skills of the printers as well as the newfound knowledge of the scholars and artists that wrote them.

Many of these works pushed the boundaries of illustrated publishing (and continue to do so to this day). They commanded expert illustrators and skilled engravers and hence didn’t come cheaply. They were treasured in the libraries of the wealthy and their intrinsic worth has meant that there is an incredible wealth of beautifully preserved historic examples from the 14th century onwards.

The significant difference we acknowledge today between astronomy and astrology has a relatively recent past, and the stars have long been associated with creatures, gods, characters and all sorts of divine beings. The study of such has a long, fascinating history that is shown in beautiful detail in the pages of these many beautiful books, and the transition from seeing the stars as characters to understanding them as spinning, celestial beings and part of our huge universe is akin to witnessing the history of the world.

Review

The blurb will tell you almost all you need to know about the book. Professor and author Karen Masters takes us through the best historical books about astronomy/astrology (as for a long time these were synonymous) from around the world. She selects best examples of books and arranges them loosely in chapters such as Star Atlases, Mapping Other Worlds, Astronomy and Culture, and Modern Astronomy – which contains a great resource list for further reading.

Rather than sticking closely to European viewpoint, entries are from all over the world with many more Islamic, Asian, and Mesoamerican examples than I’m used to seeing in similar books. The names by which they’re known might differ but the stars are the same as is the fascination of those who gazed at them and tried to understand them. I did notice a tendency for Renaissance European illustrators to include lots and lots of stargazing cheeky cherubs.

The illustrations are gorgeous and the tidbits and nuggets of information that Masters shares about her selections are fascinating. Given the layout and wealth of images, plus the fact that the digital and hardback prices aren’t that much different, it might be worth it to get a hardback copy in order to better enjoy it. The price right now will probably limit the book to hardcore enthusiasts. B

AmazonBNKoboBook DepositoryGoogle

A Travel Guide to the Middle Ages: The World Through Medieval Eyes by Anthony Bale

A captivating journey of the expansive world of medieval travel, from London to Constantinople to the court of China and beyond.

Europeans of the Middle Ages were the first to use travel guides to orient their wanderings, as they moved through a world punctuated with miraculous wonders and beguiling encounters. In this vivid and alluring history, medievalist Anthony Bale invites readers on an odyssey across the medieval world, recounting the advice that circulated among those venturing to the road for pilgrimage, trade, diplomacy, and war.

Journeying alongside scholars, spies, and saints, from Western Europe to the Far East, the Antipodes and the ends of the earth, Bale provides indispensable information on the exchange rate between Bohemian ducats and Venetian groats, medieval cures for seasickness, and how to avoid extortionist tour guides and singing sirens. He takes us from the streets of Rome, more ruin than tourist spot, and tours of the Khan’s court in Beijing to Mamluk-controlled Jerusalem, where we ride asses across the holy terrain, and bustling bazaars of Tabriz.

We also learn of rumored fantastical places, like ones where lambs grow on trees and giant canes grow fruit made of gems. And we are offered a glimpse of what non-European travelers thought of the West on their own travels.

Using previously untranslated contemporaneous documents from a colorful range of travelers, and from as far and wide as Turkey, Iceland, North Africa, and Russia, A Travel Guide to the Middle Ages is a witty and unforgettable exploration of how Europeans understood—and often misunderstood—the larger world.

Review

This looked interesting and for the most part it was. After an opening chapter on what travel means (just keep going through this), Bale dives into various historical accounts of (mainly) Europeans venturing far from home for various reasons though the last chapter covers a few journeys made to Europe, Africa, and the Arabian peninsula by people traveling westward from China and Mongolia. 

The most time is spent on religious pilgrimages to Rome, Jerusalem, Egypt, and other parts of the Middle East by European Christians. Maybe this was covered so extensively due to the availability of texts? It’s interesting but does go on a bit. Honestly, the conditions sounded as horrendous as the pilgrims probably found them to be. Traveling simply for wanderlust or pleasure didn’t appear to be that popular though perhaps the Europeans who left home for this reason decided not to go home and thus left no records? Trade was another major incentive to leave home and several merchants and traders left accounts of what they went through trying to buy and sell or set up trade hubs and links in foreign lands.   

The book jumps back and forth from various sources to cover different aspects of a typical journey that might have been made rather than sticking with one person’s narrative for a whole trip. Some travelers were enthusiastic while others were grimly determined and also expecting things to be ghastly. For pilgrims, the suffering along the way seemed to enhance the payoff of the trip (shortening time in Purgatory by years or totally for those who made it to the Holy Sepulchre in Jerusalem but check the 1450 guide in Rome to see exactly what indulgences are available and how much time you’ll save or how to get one soul out of Purgatory!). Some traders loved the chance to see new places while others caught cities or rulers having a bad day. One Chinese traveler was awestruck by Hormuz while a Mongolian Christian enjoyed sitting in a beautiful garden in Naples overlooking a sea battle.  

Bale doesn’t shy away from the fact that – just like today – people had their prejudices and preconceptions. Some of these are racist. Some people are great to travel with while others are grumps. What got written about depended on what a person thought was important rather than what we might love to read about today. 

Several fun tidbits of information are included such as an exchange rate so you know how far your plapparts will take you (also change money in Bruges where there’s a bank), don’t forget a staff (support and beating off bandits) and a bag, where to find a licensed guide in Venice who won’t cheat you while booking your travel on to the Holy Land, some travel costs in Egypt and the Holy Land (just accept that you’re going to be stiffed for money all along the way), that the locals who aren’t making money off of you will probably be annoyed by you (jeering and stone throwing are probable), some handy phrases translated into Greek, Albanian, Turkish, and Arabic, medical advice for those traveling overseas (some of which is … not bad), India has both manticores and unicorns, and when traveling from Tana to Khanbaliq (Beijing) don’t be chintzy when hiring a dragoman – splash out and hire a good one,. 

The little snapshots of things I hadn’t expected – life in a caravanserai (like a modern travel pit stop); that people from all over the world had traveled much farther into distant lands than I expected; that an Italian saw and saved two Tartars in bondage in Italy, one of whom he’d met before on his travels – were what made the book for me. It ends with sources, references, and further reading.  When it’s all said and done, it appears that travelers and traveling experiences haven’t changed all that much over the centuries. B      

AmazonBNKoboBook DepositoryGoogle

Otherworldly Antarctica: Ice, Rock, and Wind at the Polar Extreme by Edmund Stump

With stunning original photographs, an Antarctic scientist and explorer takes us to one of the most sublime, remote, and pristine regions on the planet.

The interior of Antarctica is an utterly pristine wilderness, a desolate landscape of ice, wind, and rock; a landscape so unfamiliar as to seem of another world. This place has been known to only a handful of early explorers and the few scientists fortunate enough to have worked there. Edmund Stump is one of the lucky few. Having climbed, photographed, and studied more of the continent-spanning Transantarctic Mountains than any other person on Earth, this geologist, writer, and photographer is uniquely suited to share these alien sights.

With stories of Stump’s forty years of journeys and science, Otherworldly Antarctica contains 130 original color photographs, complemented by watercolors and sketches by artist Marlene Hill Donnelly. Over three chapters—on the ice, the rock, and the wind—we meet snowy paths first followed during Antarctica’s Heroic Age, climb the central spire of the Organ Pipe Peaks, peer into the crater of the volcanic Mount Erebus, and traverse Liv Glacier on snowmobile, while avoiding fatal falls into the blue interiors of hidden crevasses. Along the way, we see the beauty of granite, marble, and ice-cored moraines, meltwater ponds, lenticular clouds, icebergs, and glaciers. Many of Stump’s breathtaking images are aerial shots taken from the planes and helicopters that brought him to the interior. More were shot from vantages gained by climbing the mountains he studied. Some were taken from the summits of peaks. Many are of places no one had set foot before—or has since. All seem both permanent and precarious, connecting this otherworld to our fragile own.

Review

Fifty years ago, geologist Edmund Stump began a love affair with the beautiful but also brutal world of Antarctica. Luckily for us, he’s also a great photographer and he snapped gorgeous pictures of the continent while doing scientific research there. Major bonus points that he accomplished this in an age before drones.

Think of purest white—the brilliance of all colors—and fathomless blue. Sprinkle in a few dark rocks and the total lack of green and you have Antarctica’s minimal pallet.

If someone offered me a chance to visit Antarctica, I’d be hard pressed to turn it down regardless of my risk of panic attacks while flying. Seriously, it wouldn’t be pretty. But if I could see IRL what I see in these images? I might take a deep breath, live better with chemistry, and go for it.

We were suspended on a transparent surface surrounded by bits and pieces of sparkling crystal, tinged blue beneath the waterline. A dome of matte gray illuminated the shadowless landscape. Ringing the cove were steep walls of ice fed by glaciers from the slopes above. Their faces bore the scars of tension and release where they had calved the icebergs that spread throughout the cove. The ice of the walls was young, only faintly blushing blue.

The book is divided into three sections: Ice, Rocks, and Wind. Stump adds geographic information for each image as well as describes his time there. There is a lot of scientific geology-speak to explain what readers are looking at which is helpful but Stump is also awed by his surroundings.

In the lifeless world of Antarctica, the wind is an animate force active in human-time— miles per hour, a heartbeat. It may be fierce, it may be calm, it may be steady, it may be restless or fickle or faint. Sometimes it isn’t even there at all. It is the bearer of cloud and the deliverer of snow. It can be a fearsome force, roiling through the mountains.

I found myself spending more time studying photos, inhaling this truly “otherworldly” place. Some photos made the landscape appear to be an intimate 50 or so feet across only to have the author reveal a scale of miles instead. Other images are up close and have a span of mere twelve inches. This is another book which is probably best as a coffee table hardback edition. B

If I had one hour more to savor Antarctica, it would be on a névé—a snowfield, circled at a distance by low mountains, snow gracefully rising to narrow ridgelines. A light breeze would nip my nose to remind me of where I was. The midnight sun would be low in the southern sky, casting long shadows and a faint alpine glow. And I would be standing in the midst of a field of the most exquisite sastrugi—wind-carved snow—as far as the eye could see.

AmazonBNKoboBook DepositoryGoogle

Primeng 12 Angular 12 Custom library: Error Symbol Fieldset declared in .... is not exported from primeng/fieldset after compileOnSave

I'm having headache with primeng and angular, it all happens when I add primeng to my Angular's library (It's already installed in main project). After building both library and main project and running "ng serve" everything is working fine. But after I compile on save I get the following error:

./src/app/app.module.ts - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js):

Error: Symbol Fieldset declared in .../src/main/ngfrontend/ngerp-libraries/node_modules/primeng/fieldset/fieldset.d.ts is not exported from primeng/fieldset (import into .../ngerp-v2/src/app/utils/modules/dynamic-file-import/components/import-matching/import-matching.component.ts)

My library package.json

"peerDependencies": {
    "primeicons": "^4.1.0",
    "primeng": "^12.2.3"
  },
  "dependencies": {
    "@angular/animations": "~12.2.14",
    "@angular/common": "~12.2.14",
    "@angular/compiler": "~12.2.14",
    "@angular/core": "^12.2.14",
    "@angular/forms": "~12.2.14",
    "@angular/cdk": "^12.2.13",
    "@angular/platform-browser": "~12.2.14",
    "@angular/platform-browser-dynamic": "~12.2.14",
    "@angular/router": "~12.2.14",
    "angular-froala-wysiwyg": "^2.7.6",
    "froala-editor": "2.7.6",
    "intro.js": "^7.0.1",
    "rxjs": "~6.6.7",
    "tslib": "^2.0.0",
    "util": "^0.12.4",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "primeicons": "^4.1.0",
    "primeng": "^12.2.3",
    "@angular-devkit/build-angular": "~12.2.16",
    "@angular/cli": "~12.2.14",
    "@angular/compiler-cli": "~12.2.14",
    "@types/jasmine": "~3.8.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~3.8.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "ng-packagr": "^12.1.1",
    "typescript": "~4.2"
  }
}

My src package.json

"dependencies": {
    "@angular-eslint/builder": "^13.0.1",
    "@angular-eslint/schematics": "^13.0.1",
    "@angular-eslint/template-parser": "^13.0.1",
    "@angular/animations": "^12.2.14",
    "@angular/cdk": "^12.2.13",
    "@angular/cli": "^12.2.16",
    "@angular/common": "^12.2.14",
    "@angular/compiler": "^12.2.14",
    "@angular/core": "^12.2.14",
    "@angular/elements": "^15.2.8",
    "@angular/forms": "^12.2.14",
    "@angular/http": "^6.1.10",
    "@angular/localize": "^12.2.14",
    "@angular/material": "^12.2.13",
    "@angular/platform-browser": "^12.2.14",
    "@angular/platform-browser-dynamic": "^12.2.14",
    "@angular/router": "^12.2.14",
    "@fortawesome/angular-fontawesome": "^0.6.1",
    "@fortawesome/fontawesome-svg-core": "^1.2.27",
    "@fortawesome/free-brands-svg-icons": "^5.12.1",
    "@fortawesome/free-regular-svg-icons": "^5.12.1",
    "@fortawesome/free-solid-svg-icons": "^5.12.1",
    "@fullcalendar/core": "^5.10.1",
    "@highcharts/map-collection": "^1.1.3",
    "@ng-bootstrap/ng-bootstrap": "^4.2.2",
    "@ngtools/webpack": "12.2.13",
    "@ngx-loading-bar/core": "^5.1.2",
    "@ngx-loading-bar/http-client": "^5.1.2",
    "@ngx-translate/core": "^10.0.0",
    "@ngx-translate/http-loader": "^3.0.0",
    "@nrwl/cli": "13.7.1",
    "@stomp/stompjs": "^7.0.0",
    "@swimlane/ngx-graph": "^6.2.0",
    "@types/chart.js": "^2.9.37",
    "@typescript-eslint/eslint-plugin": "^5.6.0",
    "@typescript-eslint/parser": "^5.6.0",
    "angular-calendar": "^0.26.11",
    "angular-draggable-droppable": "^4.6.0",
    "angular-email-editor": "^0.9.0",
    "angular-froala-wysiwyg": "^2.7.6",
    "angular-gridster2": "^8.4.2",
    "angular-mention": "0.0.5",
    "angular-mentions": "^1.5.0",
    "angular-resizable-element": "^3.4.0",
    "angular-text-input-autocomplete": "^0.3.0",
    "angularx-flatpickr": "^6.6.0",
    "awesome": "0.0.7",
    "bootstrap": "^4.6.1",
    "bulma": "^0.9.4",
    "calendar-utils": "^0.2.3",
    "chart.js": "^2.9.4",
    "company-deal-lib": "file:../ngerp-libraries/dist/company-deal-lib",
    "core-js": "^2.6.12",
    "css-element-queries": "^1.2.3",
    "d3": "^5.16.0",
    "date-fns": "^1.30.1",
    "eslint": "^8.4.1",
    "file-saver": "^2.0.5",
    "file-viewer-lib": "file:node_external_dependencies/file-viewer-lib-0.0.1.tgz",
    "flatpickr": "^4.6.9",
    "font-awesome": "^4.7.0",
    "froala-editor": "2.7.6",
    "fs-extra": "^9.1.0",
    "fullcalendar": "^4.0.0-alpha.4",
    "google-libphonenumber": "^3.2.25",
    "highcharts": "^9.1.0",
    "highcharts-angular": "^2.10.0",
    "html2canvas": "^1.4.1",
    "html2pdf.js": "^0.10.1",
    "igniteui-angular-core": "^12.1.2",
    "igniteui-angular-excel": "^12.1.2",
    "igniteui-angular-spreadsheet": "^12.1.2",
    "intro.js": "^7.0.1",
    "jquery": "^3.6.0",
    "jspdf": "^2.5.1",
    "models-lib": "file:../ngerp-libraries/dist/models-lib",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.37",
    "net": "^1.0.2",
    "ng-drag-drop-list": "^3.0.0",
    "ng2-file-upload": "^1.4.0",
    "ng2-pdf-viewer": "^6.4.1",
    "ngx-embed-video": "^1.0.4",
    "ngx-image-cropper": "^3.3.5",
    "ngx-international-phone-number": "^1.0.6",
    "ngx-loading": "^8.0.0",
    "ngx-quill": "^13.0.1",
    "ngx-spinner": "^12.0.0",
    "ngx-take-until-destroy": "^5.4.0",
    "ngx-tribute": "^1.5.1",
    "node": "^12.22.7",
    "number-2-letters": "^0.5.0",
    "powerbi-client": "^2.22.3",
    "primeflex": "^1.3.1",
    "primeicons": "^4.1.0",
    "primeng": "^12.2.3",
    "quill": "^1.3.7",
    "quill-mention": "^3.1.0",
    "rrule": "^2.6.8",
    "rxjs": "^6.6.7",
    "save-as": "^0.1.8",
    "sockjs-client": "^1.6.1",
    "stomp": "^0.1.1",
    "stompjs": "^2.3.3",
    "subsink": "^1.0.2",
    "sweetalert2": "^7.33.1",
    "tributejs": "^5.1.3",
    "tslib": "^2.0.0",
    "util": "^0.12.4",
    "utils-lib": "file:../ngerp-libraries/dist/utils-lib",
    "webpack": "^5.75.0",
    "window-lib": "file:../ngerp-libraries/dist/window-lib",
    "xlsx": "^0.18.5",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^12.2.16",
    "@angular/compiler-cli": "^12.2.14",
    "@angular/language-service": "^12.2.14",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "^2.0.10",
    "@types/node": "^12.20.37",
    "codelyzer": "~4.5.0",
    "config": "^3.3.6",
    "css-minimizer-webpack-plugin": "^4.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.9",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.11.0",
    "typescript": "4.2"
  }

I couldn't understand the reason, can somebody please suggest what needs to be done?

I tried the official documentation. adding Primeng to peerDeependecies....

How to test a function component in React with a function as props

I'm testing a function component with Jest, however, I get an error when I pass a function as props:

/..../src/pages/AddCommentComponent.tsx:43 props.updateCommentsHandler(); ^

TypeError: props.updateCommentsHandler is not a function at updateCommentsHandler (/.../src/pages/AddCommentComponent.tsx:43:11)

Any idea how I can specify the props.updateCommentsHandler when render(<AddCommentComponent />) and also test the function as well? The rest of the test is correct and passes.

AddCommentComponent.tsx:

const AddCommentComponent = (props: any) => {
  const [newComment, setNewComment] = useState<string>();

  const onNewCommentUpdate = (e: React.FormEvent<HTMLTextAreaElement>) => {
    setNewComment(e.currentTarget.value);
  };

  const updateCommentsHandler = () => {
    props.updateCommentsHandler();
  };

  const onSubmit = async () => {
    await axiosInstance.post("/comments", {
      post: newComment,
    });

    updateCommentsHandler()
  };

  return (
    <div>
      <textarea
        aria-label="new-comment-box"
        placeholder="Enter your comment..."
        onChange={onNewCommentUpdate}
      >
        {newComment}
      </textarea>
      <button aria-label="submit-button" disabled={false} onClick={onSubmit}>
        Submit
      </button>
    </div>
  );
};

export default AddCommentComponent;

AddCommentComponent.test.tsx:

jest.mock("../libs/axios");

describe("AddCommentComponent", () => {
  describe("when the user has entered a comment", () => {
    test("clicking submit should save the comment", () => {
      const comment = "Test comment";
      render(<AddCommentComponent />);

      const commentInputBox = screen.getByLabelText("new-comment-box");
      fireEvent.change(commentInputBox, { target: { value: comment } });

      const submitButton = screen.getByRole("button", {
        name: "submit-button",
      });
      fireEvent.click(submitButton);

      expect(axiosInstance.post).toHaveBeenCalledWith("/comments", {
        comment,
      });
    });
  });

Failing to mock setState in react component on unit testing

I have a minimal demo here. There are 2 counter components, I am trying to test the increment functionality. The one on the top is passing setState from props, it does not increment when i mock clicking. On the other hand, the bottom one is an isolated component, which works perfectly.

What's causing this issue? How to make the one on the top work? Is it a anti-pattern to mock react setState?

Thanks.

I tried the code below. It still does not work expectly

it('should test what goes into the state, () => {
  const setState = jest.fn();
  jest
    .spyOn(React, 'useState')
    .mockImplementationOnce(initState => [initState, setState]);
  render(<MyComponent />);
});

How to get set of colours in an image using python PIL

After importing an image using python's PIL module I would like to get the set of colours in the image as a list of rgb tuples.

What If I know before hand that there will only be 2 colours and the image will be very small, maybe 20x20 pixels? However, I will be running this algorithm over a lot of images. Will It be more effiient to loop through all pixels until I see 2 unique colours? Because I understand loops are very slow in python.

Add Media with Spatie/laravel-medialibrary without related to model (Laravel)

I am using latest version (10.15) of Spatie/laravel-medialibrary.

It is very simple to upload media rlated to a model, look like this:

$model->addMediaFromRequest('file');

or in other ways.

But, now I want to put some files without related to any model instance.

As mentioned in this issue https://github.com/spatie/laravel-medialibrary/pull/1443, I have tried to use $media = Media::addFromRequest('image')->toMediaCollection('images'); but there is no static method with this name,

It is okay to use other strategies like put in storage without using this package, but it is good to know if there is any way to do my desire.

Anyhow, if you know how I resolve this problem I appreciate you to increase developers' society knowledge.

Thanks

Why performance of this function is so slow on Intel i3-N305 compared to AMD Ryzen 7 3800X?

I've run the same binaries compiled with gcc-13 (https://godbolt.org/z/qq5WrE8qx) on Intel i3-N305 3.8GHz and AMD Ryzen 7 3800X 3.9GHz PCs. This code uses VCL library (https://github.com/vectorclass/version2):

int loop_vc_nested(const array<uint8_t, H*W> &img, const array<Vec32uc, 8> &idx) {
  int sum = 0;
  Vec32uc vMax, iMax, vCurr, iCurr;

  for (int i=0; i<H*W; i+=W) {
    iMax.load(&idx[0]);
    vMax.load(&img[i]);

    for (int j=1; j<8; j++) {
      iCurr.load(&idx[j]);
      vCurr.load(&img[i+j*32]);
      iMax = select(vCurr > vMax, iCurr, iMax);
      vMax = max(vMax, vCurr);
    }

    Vec32uc vMaxAll{horizontal_max(vMax)};
    sum += iMax[horizontal_find_first(vMax == vMaxAll)];
  }

  return sum;
}

Full benchmark source is here: https://github.com/pauljurczak/simd-benchmarks/blob/main/main-5-vcl-eve.cpp. Here is the timing:

Ubuntu 22.04.3 LTS on AMD Ryzen 7 3800X 8-Core Processor
gcc    v13.1   __cplusplus=202100
loop_vc_nested(): 3.597  3.777 [us]  108834

Ubuntu 23.10 on Intel(R) Core(TM) i3-N305
gcc    v13.1   __cplusplus=202100
loop_vc_nested(): 11.804  11.922 [us]  108834

There is an unexpected slowdown of 3.2x. AFAIK, these CPUs have similar SIMD capabilities for a single thread program. Performance on 7-zip benchmark is very close. Why such a big gap?

React Unit Test : Redux State is not getting updated with mock response

Writing unit tests for my React (Typescript) application where I am using MSW service for Mocking response For state management using Redux toolkit . The issue is I am able to get mocked Response in my reducer case inside slice but it is not further updated state and hence I am not able to test component further .

Below is the Redux code , if you check any of the below async method eg: fetchMoviesAsync so I am able to get mock data inside it's case where I am able to console it .

import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit";
import movieApi from "../../common/apis/movieApi";
import { APIKey } from "../../common/apis/MovieApiKey";
import { InitialState, MovieOrShowDetails } from "../../interfaces/interfaces";
import { RootState } from "../store";
import { nestedMovieObj } from "../../interfaces/interfaces";

const initialState: InitialState = {
  movies: {},
  shows: {},
  movieOrShowDetail: {},
  movieStatus: "pending",
  showStatus: "pending",
};

export const fetchMoviesAsync = createAsyncThunk<nestedMovieObj, any>(
  "movies/fetchMoviesAsync",
  async (term: string, thunkAPI) => {
    const response = await movieApi.get(
      `?apiKey=${APIKey}&s=${term}&type=movie`
    );
    console.log("term movies", term);
    return response.data;
  }
);

export const fetchShowsAsync = createAsyncThunk<nestedMovieObj, any>(
  "movies/fetchShowsAsync",
  async (term: string, thunkAPI) => {
    const response = await movieApi.get(
      `?apiKey=${APIKey}&s=${term}&type=series`
    );
    console.log("Data res...");
    return response.data;
  }
);

export const fetchMovieOrShowDetailAsync = createAsyncThunk<
  nestedMovieObj,
  any
>("movies/fetchMovieOrShowDetailAsync", async (id, thunkAPI) => {
  const response = await movieApi.get(`?apiKey=${APIKey}&i=${id}&Plot=full`);
  return response.data;
});

const movieSlice = createSlice({
  name: "filmData",
  initialState,
  reducers: {
    // here we have used normal reducer to reset/cleanup purpose
    // hence you can see below in all actions we have reset respctive data
    removeMovieOrShowDetail: (state) => {
      state.movieOrShowDetail = { Response: "", totalResults: "", Search: [] };
    },
    movieDetail: (state) => {
      state.movies = { Response: "", totalResults: "", Search: [] };
    },
    ShowDetail: (state) => {
      state.shows = { Response: "", totalResults: "", Search: [] };
    },
  },

  extraReducers: (builder) => {
    builder.addCase(fetchMoviesAsync.pending, (state) => {
      state.movieStatus = "pending";
      return state;
    });
    builder.addCase(
      fetchMoviesAsync.fulfilled,
      (state, action: PayloadAction<nestedMovieObj>) => {
        state.movies = action.payload;
        state.movieStatus = "resolved";
        console.log("State data ", state);
        return state;
      }
    );
    builder.addCase(fetchMoviesAsync.rejected, (state) => {
      console.log("Rejected ", state.movies);
    });

    builder.addCase(fetchShowsAsync.pending, (state) => {
      state.showStatus = "pending";
      return state;
    });

    builder.addCase(
      fetchShowsAsync.fulfilled,
      (state, action: PayloadAction<nestedMovieObj>) => {
        state.showStatus = "resolved";
        state.shows = action.payload;
        return state;
      }
    );

    builder.addCase(
      fetchMovieOrShowDetailAsync.fulfilled,
      (state, action: PayloadAction<nestedMovieObj>) => {
        state.movieOrShowDetail = action.payload;
        return state;
      }
    );
  },
});

export const getAllMovies = (state: RootState) => {
  console.log("Movies state", state);
  return state.filmData.movies;
};
export const getAllShows = (state: RootState): nestedMovieObj | {} =>
  state.filmData.shows;
export const getMovieStatus = (state: RootState): string =>
  state.filmData.movieStatus;
export const getShowsStatus = (state: RootState): string =>
  state.filmData.showStatus;
export const getMovieOrShowDetails = (
  state: RootState
): MovieOrShowDetails | {} => state.filmData.movieOrShowDetail;

export const { removeMovieOrShowDetail, movieDetail, ShowDetail } =
  movieSlice.actions;

export default movieSlice.reducer;

Below is the my test file :

 import { getByAltText, render, screen, waitFor } from "@testing-library/react";
import Home from "./Home";
import { renderWithProviders } from "../../utils/testUtils";

import { http, HttpResponse, delay } from "msw";
import { setupServer } from "msw/node";
import App from "../../App";
import { PreloadedState } from "@reduxjs/toolkit";
import { InitialState, MovieOrShowDetails } from "../../interfaces/interfaces";

// This configures a request mocking server with the given request handlers.
 
 

test("Rendering default movie/shows", async () => {
  renderWithProviders(<Home />);
  
});

Here I am rendering component with customized render function as per official document .

But I am not able to get updated state data inside respective component .

Few people suggested me that I am still using CRA to create React app so do not use that , may be that is causing the issue . But I am little confused about it

Code for customized render function

import React, { PropsWithChildren } from "react";
import { render } from "@testing-library/react";
import { Provider } from "react-redux";
import type { RenderOptions } from "@testing-library/react";
import type { PreloadedState } from "@reduxjs/toolkit";

import { setupStore } from "../features/store";
import type { AppStore, RootState } from "../features/store";

interface ExtendedRenderOptions extends Omit<RenderOptions, "queries"> {
  preloadedState?: PreloadedState<RootState>;
  store?: AppStore;
}

export function renderWithProviders(
  ui: React.ReactElement,
  {
    preloadedState = {},
    // Automatically create a store instance if no store was passed in
    store = setupStore(preloadedState),
    ...renderOptions
  }: ExtendedRenderOptions = {}
) {
  function Wrapper({ children }: PropsWithChildren<{}>): JSX.Element {
    console.log("STORE...", store.getState());
    return <Provider store={store}>{children}</Provider>;
  }
  // Return an object with the store and all of RTL's query functions
  return { store, ...render(ui, { wrapper: Wrapper, ...renderOptions }) };
}

I was having doubt on CRA configuration but after doing lot of configuration still no luck

Unlocking Library Coolness: Many, Many Awesome Things

Your local library might be doing some really, really cool things that you don’t know about. Here are a few incredibly awesome programs at libraries around the country, along with pictures of cats because why not?

COVID Tests and Masks

Recently we went to visit Freebird at college, and I brought a stack of COVID tests because…dorm, and because the only CVS within walking distance of campus was always sold out.

But I can get free COVID tests at our library, and brought him several. Freebird’s roommate seemed shocked that I could get free COVID tests anywhere, but our library system has offered them every day, two per patron, and free packs of face masks, one box per patron.

There’s even a website where each branch can update whether they’re out of masks or test kits each day so you don’t drive all over without finding any. This program is funded by a bunch of county partners, and it’s wonderful. A few library systems in my area have similar programs, including Carroll County in Maryland, Alexandria Library in Virginia, and Pratt Free Library in Baltimore.

Katie, a small brown tabby with a notched ear and big green eyes, sitting on a fleece blanket
Katie, aka Lady Katherine Megatron, Princess of Tails

Books Unbanned: ebook access for teens in the US

The Brooklyn Public Library is offering free cards to anyone in the nation ages 13-21 a free library card to access their free eBook collection. The Brooklyn Public Library has always offered free library cards to teenagers in New York State, but this program expands access to anyone in the US to combat book bans and book challenges in different parts of the country.

The Boston Public Library, the LA County Public Library, and the Seattle Public Library have also launched their own Books Unbanned programs.

I had an out-of-state Brooklyn library card for which I’d paid a small fee until earlier this year, when it expired. Brooklyn is no longer offering out-of-state cards as of July 2022, and to be a cardholder you just have to live, work, pay property taxes or attend school in all of New York State. Alas, that isn’t me, and I was a little bummed about it, until I realized I’d be happy to give up my BPL card (amazing collection, not going to lie) so teenagers all over the country could read books. (I do miss my BPL card, though.)

According to their latest press release, more than 100,000 books have been checked out by teens across the US in the past year. That’s awesome.

I asked the team here at SBTB HQ about what cool things their libraries were doing, and…wow.

My cat Dewey sits with is paw on the cover of the book, closing it on me
Dewey

Kiki: My library system, the Minuteman Library Network (Massachusetts) has a “library of things” where you can take out anything from games to ice cream makers or a sewing machine.

The little branch closest to me has a “take a puzzle, leave a puzzle” which I adore and has saved my puzzle budget many, many times, and it has a little seed library! You can donate seeds that you aren’t going to use so that someone else in the community can use them.

Sarah: I just searched “public library puzzle swap” and my gosh there are so many. I LOVE THIS.

Amanda's cat Linus. He's a white and tan Maine Coon mix and is very fluffy. He's lying on his back, holding his catnip beaver in his paws and up to his mouth.
Linus, and his catnip beaver.

Tara: I’m not sure if it’s different enough, but for me, it’s the apps they have!

Calgary Public Library has Libby and Overdrive, but Libby is the very best for getting audiobooks and ebooks. I rarely don’t have an audiobook out from there.

I also love their video service, called Kanopy. I’ve seen some excellent documentaries and am currently making my way through the first 6 seasons of Alone.

They also have a drag storytime series called Reading with Royalty, which includes drag queens, kings, and monarchs. Thankfully our city introduced a bylaw to prohibit protesting within 100 metres, after a pastor scared some kids at one in February.

Maya: Kanopy is so great! Kanopy has a deal with A24, so you can watch a lot of their films for free!

Also, my library (and I think this is available for the whole state of California) has LinkedIn Learning and Coursera for free. If you can learn through video lectures, there’s a lot to be found on those sites!

Fisher, a brown, grey and white longhair, looks dirty and very put out
A dirty, grumpy kitten.

Shana: I love that the Sacramento Library has a cake pan collection.

Sarah: I love this a LOT.

Shana: They also let you access NYT Cooking for 24 hours at a time, and Craftsy.

You could have a whole baking business through my library. You can check out a kitchen aid stand mixer too.

Sarah: Yes! Craftsy! Also, I taught myself some sewing techniques by following tutorials on Creativebug through my library. My first projects were cloth napkins and pajama pants with elastic waists with video tutorials from the library access catalogs.

For good napkins, I recommend buying flannel when it’s on sale at a place like Joann’s or Michaels, and sewing sets of four or six. They get softer as you wash them, and it’s a good opportunity to practice consistent seams and to use the fun decorative stitches that might come with the machine!

Toast, a light tan fluffy cat, sits in a doorway with big eyes while Linus, a cream and tan massive fluff ball, lounges in the doorway
Toast (L) and Linus (R)

Also: many libraries have “makerspaces” where you can use all sorts of different technology to make things. The DC Library has The Labs, which offers digital preservation equipment, machinery and other tools, and a dance and audiovisual studio.

Tara: Whoa, I just checked the Calgary Public Library and found out they have a TON of stuff I didn’t know about. You can check out board games, take a laptop home for 3 weeks, view Indigenous art installations, access mental health supports, and build a whole bunch of skills. I’m actually pretty blown away and need to do some more exploring.

Claudia: We have a lot of the stuff already mentioned and also a ton of one-on-one coaching and small-group learning: career, financial literacy, resume building… their English as second language groups attract people from all over the world. The library also offers free tickets to area museums, the zoo, and state parks.

Sarah: I saved SO MUCH MONEY using museum passes from the Montclair Public Library when we lived in New Jersey. Getting into the Children’s Museum with their free admission pass was pretty exhilarating, especially when the kids got bored and it was no big deal to leave.

Chips the butthole bandit

Sneezy: This sort of falls under cool service, but isn’t what I’d typically think of as a library service. The library I usually go to in Taiwan has really good security. There are security cameras absolutely everywhere around their reading and studying spaces, and people just leave ALL their stuff there. Not just workbooks and pencils, also all their electronics. Laptops, tablets, chargers, mouse, all of it. It makes more sense to them to save their spot if they pop out for a drink or some food than to worry about their stuff being stolen. Part of it is definitely a general sense of trust and security within the community, but it still feels weird and amazing that the library would take on the responsibility for catching or at least preventing theft.

Susan: Manchester Central Library (UK) has instruments that you can book sessions with! So if you want to practice the drums or something, you can plug yourself in and go.

And when Universal Credit rolled out in the UK, Derbyshire libraries had a programme where library staff would sit with people and walk them through the process – setting up an email address, signing up for benefits, the whole thing.

What about you? Brag to us about your library! Do they have cool programs? Conversation groups? Makers labs or a fulsome collection of baking equipment? Tell us about it!

And if you’re not sure what your library is up to, I bet it’s something really nifty.

Guest Post: Library Board Adventuring One Year In

This guest post is from Crystal Anne. Crystal Anne with An E comes to us from a sunny clime, but prefers to remain a pale indoor cat. She enjoys reading, cross-stitching something nerdy, going to see live music, and playing video games. She works as an autism consultant by day, got a degree in information science for fun, and currently serves on her local library advisory board.

Last year, I wrote about my quest to become a member of the advisory board for my local public library system. I am now a year into my tenure on the board, and was hoping that over the last year, cooler heads would begin to prevail and the national enthusiasm for banning and challenging books and making the lives of library staff hell would have died down.

Yes, I know. I was delusional. It was a nice thought while it lasted.

Not only did it not get better, it has gotten worse.

Sigh. I’ll stop with the links now, I’m just making myself sad.

I said in my previous article that I had not had the experience of being on a book challenge review as yet. In the months since, the book Ace of Spades by Faridah Àbíké-Íyímídé ( A | BN | K | AB ) was banned in my local school district. We discussed that ban at one of our board meetings, because the library director said that she felt like it presaged things to come.

Ace of Spades
A | BN | K | AB
And so it did.

In the last month, a patron of the local library submitted a formal “reconsideration request” for a book. A “reconsideration request” is the official challenge, in which the patron can request that the book either be removed from the collection altogether or moved to another section of the library.

I cannot be overly specific about what the book was, because I don’t want to put my library system in an awkward spot. I’ll give you this much. It was a picture book, and it featured a cast of worms and bugs.

This, and I cannot stress this enough, PICTURE BOOK, was challenged on the basis of containing “inappropriate sexual content.” The request from the patron was that the book be removed from the collection altogether or, barring that, moved to the teen section. When the paperwork was submitted, the library director asked for a volunteer from the board to serve on the review committee.

Click for me

Melissa Fumero as Amy on Brooklyn 99 stands up and says Me! I'll do it! I volunteer all my time!

Thankfully, since this was a picture book (I sigh nearly every time I type it), it took me approximately three minutes to read the entire story.

The review form took a little bit longer, since I may have taken my job a bit too seriously, and got very busy in the comment section. It should also be noted that since I had, at the time of getting the book, just picked up my teenage daughter from school, I had her read it as well. When she was done, she looked at me, and said in the withering tone that can only be summoned by an exasperated adolescent: “It’s. About. WORMS.”

The upshot of this is that the rest of the committee (two staff members of the library, with input from the director as well) and myself unanimously recommended that the book should remain where it was in the children’s section. If the patron chooses, they can escalate the challenge further, at which point they would have to present their case to the whole board. To my knowledge, that has not been pursued at this time.

This is a very, very mild case.

There are many more alarming examples of people attempting to purge the content of libraries that they personally disagree with. That’s not even getting into the personal threats and harassment that many librarians are experiencing at their jobs. Again, this part has not gotten hugely bad in my area. Which is not to say that absolutely nothing has happened. We’ve had some complaints about displays, with those complaints spiking during Pride Month, because of course they did.

We’ve also had some individuals that took it upon themselves to “debate” with library staff about the inclusion of materials that they disagreed with, but none of those escalated to the point in which security staff needed to be involved or that person took it upon themselves to initiate a challenge to the material in question. I am proud to say that our library staff are highly efficient at listening to the arguments being made to them, and then politely refuting those arguments and protecting the diversity of the collection.

In addition, there is pushback taking place. Many libraries have had to redo their collection management policies to protect against bad actors. Examples of this would be requiring that a separate form has to be completed for each item being challenged, to prevent someone from filling out a form and listing several items, and requiring the person challenging the item provide specific page numbers and passages to prove that they actually bothered reading the book they’re trying to remove. There is also the adding of a provision to the policy saying that if an item has been challenged in the last, say three to five years, the original determination remains.

At least one librarian that I follow on the Twitters (no, I am never calling it the other thing) added a question to their form that asks the person completing it why they think they should have the authority to tell others what to read.

Aw, yeah.

Jack Black giving a fierce salute gesture in front of a blackboard above the caption MAD RESPECT

Obviously, this problem isn’t going away anytime soon.

So now we talk about what we can do to support our libraries as they deal with these many difficulties.

  1. If you have the time and inclination, get on a library board. We are the ones that can best advocate for the library when something bad happens. If the ones that love and support libraries aren’t on these boards, then people who do not at all have the best interests of the library at heart will be. That is happening already, and there are library systems suffering because of it.
  2. Advocate for funding. There are politicians throughout the country that are literally voting to defund their local libraries. I think many of us have heard about a library in Michigan that was defunded over the inclusion of LGBTQ+ books in their collection. It was, literally, NORA FREAKING ROBERTS that had to step in and make a huge donation that saved the library for that fiscal year. But she can’t save every library. That’s on the rest of us.
  3. Tell the library staff how much you appreciate them and the work they do. They need to hear it, especially when they have so many people trying to make their lives difficult. And yell it on social media and in the press if you have the opportunity.
  4. Be aware of the collection management policy of your local library. In the event that something gets incredibly contentious, as many of these challenges have done, it would be good to have community advocates at the meetings (which are always open to the public) that can effectively push back against the bad actors, and use the policies in place to do it. To paraphrase my very Gen Z daughter: DRAG THEM.

These are just a few of the options available to those of us that are really just the people that use our libraries, and want them to continue being available to our communities. For more strategies and ideas about ways to support your libraries and fight the frankly disgusting nonsense that many are engaging in, there are two articles below that can help you get started.

I cannot stress enough that we need those on the side of good working on this. Because the people on other side are highly motivated, extremely organized and methodical, and they are working hard to undermine the mission and operations of libraries, even if they don’t think that’s what they’re doing.

If I sound like I’m making this adversarial, all I can say is that they started it.

So I guess we’re doing this.

Let's go!

A scout leader from the show GHOSTS has an arrow through his neck and says Well that sounds like a super fun challenge

Ed.note: many libraries have a board, but in larger systems, each branch may have its own advisory committee — and if you find a library system that has a board, a committee, and a task force, then you drink! (Kidding.) There may be other points of entry for you to be involved in your local branch as well.

Are you involved in your local library system? What sorts of things do you do? 

And thank you Crystal for this report, and for fighting the good fight!

Links: Book Recs, Auctions, Matt Berry, & Peter Capaldi

Workspace with computer, journal, books, coffee, and glasses.Welcome back to Wednesday Links!

I just got back from taking Linus to the vet for a check up and he’s gained a pound, which is great. (Backstory: Linus was diagnosed with a thyroid condition about two years ago and seeing his weight come back has been great.) However, he is very much a grumpy old man with lots of fighting spirit.

We’re also getting some fall weather in New England, so I’m making chili! This was a household staple for us and my brother usually requested it as his birthday meal. To all you Texans out there, sorry to say that my chili does indeed included beans.

Halal romance novels are on the rise! You can read more about them and get some recs in this article on Hyphen.

The Ashland Library, which is located in Massachusetts, has kicked off a pretty cool romance auction. Authors are offering up “swag bags” which include things like books, art, and even Zoom calls.

As if we don’t all have a big enough TBR pile, Tor has recommendations for dark academia fantasy with angry heroines. Definitely my jam!

Enjoy British greats, Matt Berry and Peter Capaldi, as they reenact a “fiery letter exchange.”

Don’t forget to share what cool or interesting things you’ve seen, read, or listened to this week! And if you have anything you think we’d like to post on a future Wednesday Links, send it my way!

An update to Component inside a test was not wrapped in act(...)

test('renders header, sidebar and data grid table', () => {
  // Axios cannot be imported in unit test
  act(() => {
    render(
      <Provider store={store}>
        <App />
      </Provider>
    );
  })
  const dataGridTableElement = screen.getByTestId('dataGridTable');
  expect(dataGridTableElement).toBeInTheDocument();
  const blockStatsElement = screen.getByTestId('blockstats');
  expect(blockStatsElement).toBeInTheDocument();
  const headerElement = screen.getByTestId('header');
  expect(headerElement).toBeInTheDocument();
  const sidebarElement = screen.getByTestId('sidebar');
  expect(sidebarElement).toBeInTheDocument();
});

This is the only test I have in that test file.

No matter if I put the render inside an act(...) or not, the same warning would be shown.

    Warning: An update to Sidebar inside a test was not wrapped in act(...).
    
    When testing, code that causes React state updates should be wrapped into act(...):
    
    act(() => {
      /* fire events that update state */
    });
    /* assert on the output */

That "Sidebar" is a component inside <App />.

I have no idea how to solve this issue. It would be much appreciate if anyone can help me out with this.

This is in react 18 btw, so Enzyme is not usable.

Can I use std-stream for the C++23 extended floating point types?

I found the interesting extended floating point types in C++23 at https://en.cppreference.com/w/cpp/types/floating-point. My g++ 13.2 has no overload for

   std::cout << 0.1f128;

Is this intentional (by the standard) or just a missing feature in g++ right now?


This is my code:

#include <limits>
#include <iostream>

#include <stdfloat>

using namespace std;

template <typename Float>
void show(const char* name, const Float example) {
    cout << name << " with 0.1:" << example << '\n';
    cout << "  digits10 = " << numeric_limits<Float>::digits10 << '\n';
    cout << "  max_digits10 = " << numeric_limits<Float>::max_digits10 << '\n';
    cout << "  min_exponent10 = " << numeric_limits<Float>::min_exponent10 << '\n';
    cout << "  max_exponent10 = " << numeric_limits<Float>::max_exponent10 << '\n';
    cout << "  min() = " << numeric_limits<Float>::min() << '\n';
    cout << "  max() = " << numeric_limits<Float>::max() << '\n';
    cout << "  epsilon() = " << numeric_limits<Float>::epsilon() << '\n';
    cout << "  round_error() = " << numeric_limits<Float>::round_error() << '\n';
    cout << "  denorm_min() = " << numeric_limits<Float>::denorm_min() << '\n';
}
#define SHOW(ftype,example) show<ftype>(#ftype, example)

int main() {
    SHOW(float, 0.1f);
    SHOW(double, 0.1);
    SHOW(long double, 0.1l);
    SHOW(std::float16_t, 0.1f16);
    SHOW(std::float32_t, 0.1f32);
    SHOW(std::float64_t, 0.1f64);
    // SHOW(std::float128_t, 0.1f128);  // <<< missing
    SHOW(std::bfloat16_t, 0.1bf16);
}

This my makefile rule:

CXX23FLAGS=-Wall -Wextra -std=c++23 -lpthread -pthread -Wno-missing-field-initializers -g -fext-numeric-literals

CXX:=docker run --rm -i -t --volume $(CURDIR):/workdir --workdir /workdir gcc:13.2 g++

%.x: %.23.cpp
    $(CXX) $(CXX23FLAGS) -o $@ $<

ReferenceError: regeneratorRuntime is not defined when running testing

I am trying to figure out how to add testing to my React application. I am using React Testing Library. I am getting this error ReferenceError: regeneratorRuntime is not defined when I try and run the test.

This is what the test file looks like:

import {
    render,
    screen,
    within,
    fireEvent,
    waitFor
} from '@testing-library/react';
import Providers from '../../context/GlobalContextProviders';
import { BrowserRouter as Router } from 'react-router-dom';
import IngredientsCenter from '../views/IngredientsCenter';

function renderWithProviders(el) {
    render(
        <Providers>
            <Router>{el}</Router>
        </Providers>
    );
}

test('The ingredients table exists on the screen', async () => {
    renderWithProviders(<IngredientsCenter />);
    const ingredientsTable = screen.getByRole('ingredients-table');
    await waitFor(() => {
        expect(ingredientsTable).toBeTruthy();
    });
});

Full error with partial relevant stack trace:

regeneratorRuntime is not defined
ReferenceError: regeneratorRuntime is not defined
    at C:\...\node_modules\react-table\src\publicUtils.js:169:10
    at useAsyncDebounce (C:\...\node_modules\react-table\src\publicUtils.js:169:10)
    at GlobalFilter (C:\...\src\components\pieces\IngredientsTable.js:27:19)

And then this is the IngredientsTable file up to just past line 27:

import React, { useState } from 'react';
import {
    useTable,
    useSortBy,
    useGlobalFilter,
    useAsyncDebounce
} from 'react-table';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
    faSortUp,
    faSortDown
} from '@fortawesome/pro-duotone-svg-icons';
import {
    faCheck,
    faEllipsisV
} from '@fortawesome/pro-regular-svg-icons';
import { Scrollbars } from 'rc-scrollbars';

// Define a default UI for filtering
const GlobalFilter = ({
    preGlobalFilteredRows,
    globalFilter,
    setGlobalFilter
}) => {
    const count = preGlobalFilteredRows.length;
    const [value, setValue] = useState(globalFilter);
    const onChange = useAsyncDebounce((value) => {
        setGlobalFilter(value || undefined);
    }, 200);

I have googled this error and looked it up on here and nothing I have found has helped me. Can someone figure out why my test would be failing with that error?

❌
❌