meteor / meteor/react-packages

Add instructions for how to run tests in readme

Open
#357 4 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
JavaScript
Stars
575
Forks
168
Avg merge
4d 3h
Merged PRs (30d)
1

Description

Hi,

I am interested in exploring the existing tests and writing some new ones to check behaviour with React 18 and concurrency. I am on an M1 MacBook and needed to update Meteor so that may be the root of my issues. I can copy the tests out of this repository and they run though so I may also be misunderstanding how they should be run.

I have tried:

cd tests/react-meteor-data-harness
meteor npm install
meteor npm test

This required manually `meteor npm install @babel/runtime jquery` and ultimately errors in the browser with `- exception - message Can't find variable: ReactMeteorData`

Next approach also from `tests/react-meteor-data-harness`:

PACKAGE_DIRS=../../packages meteor test-packages // Errored with missing dev packages
meteor npm i --save-dev @testing-library/react@^12.0.0 @testing-library/react-hooks
PACKAGE_DIRS=../../packages meteor test-packages // Test results in browser but all fail
meteor npm I --save react@^17.0.0 react-dom@^17.0.0
PACKAGE_DIRS=../../packages meteor test-packages

Ultimately getting many green tests but hanging indefinitely in `useTracker` `resubscribe` tests.

My thought is that with many permutations of running `npm install`, `npm test`, `meteor test`, and `meteor test-packages` at various directory levels it would be helpful to add a few sentences describing a combination that is expected to work. A link to a CI script that run the tests would also be helpful if one exists.

It may be that the correct path is meant to be:

cd tests/react-meteor-data-harness
meteor npm install
meteor npm test
PACKAGE_DIRS=../../packages meteor test-packages

And all my problems stem from M1 and the Meteor update resulting in missing dependencies. If so I am happy to make a pull request adding these instructions and ignoring my update journey. Adding a `package.json` script to run the package tests would also simplify and clarify the process.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in tests/react-meteor-data-harness and verify the documented npm and Meteor test commands, including PACKAGE_DIRS=../../packages meteor test-packages. Compare the working setup with the reported missing dependencies and hanging useTracker resubscribe tests, then add concise README instructions and, if confirmed by the repository, a package.json test script or CI link.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation, testing
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.