Open mikowals opened 2 years ago
The challenge with these tests is they are very old, and SimpleTest is not well documented. I kind of loathe it, but it's what we have.
To get the tests to work, first of all, install the local npm packages. Note, they have to be installed as regular dependencies, not dev dependencies. (And they should be removed before publishing, which should also be documented somewhere.)
The next step is to run it with an older version of meteor! New version don't work due to various bugs. CD in to the react-packages/packages/react-meteor-data
folder, install the deps with meteor npm i
then run with an older version:
meteor test-packages ./ --release 1.12.1
On M1 you'll need to specify arch to get it to run in rosetta 2
arch -x86_64 meteor test-packages ./ --release 1.12.1
It will be very very slow... It might even stall a couple of times (like at the end of the first time a given version's meteor-tool installs), but eventually it will start.
I don't think it matters which version or arch of node/npm you use to install the node_modules, because it doesn't rely on any native modules, but maybe stick with some variant of npm 6.
The tests in the individual packages are not integrated in the repo's main test harness. That maybe is for the older packages? IDK.
@CaptainN what do we need to do to update those tests and also keep it with the latest Meteor version available?
There are bugs in the latest versions of Meteor that cause the tests to fail (mostly with node_modules path resolution inside packages). Those bugs need to be fixed.
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:
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
: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
, andmeteor 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:
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.