MithrilJS / ospec

Noiseless testing framework
MIT License
48 stars 13 forks source link

Fix critical import bug and missing changelog links #28

Closed dead-claudia closed 3 years ago

dead-claudia commented 3 years ago

Description

  1. Fix a critical import bug that somehow got missed (and nobody said anything)
  2. Add a couple missing changelog links.
  3. Fix a slew of outdated references in the release process.
  4. Get tests running on Windows. (cmd was running ospec.js in the root rather than node_modules/.bin/ospec due to a very unusual choice of behavior, and even npx wasn't sufficient to prevent that. Also, the scripts didn't fully match npm's stubs, and that caused its own set of problems on Windows.)
  5. Avoid testing ospec with the repo's version, as it made the bug more difficult to test.

Motivation and Context

Encountered this while working on Mithril after updating ospec. (I fixed it short-term by explicitly moving the dependency back a few versions.)

The plan is to release this ASAP once I confirm it either locally or via CI (hence this PR and the way the changelog is updated). Locally, I've been dealing with issues with the tests assuming a Unix system, but I don't believe this should carry over into other platforms.

How Has This Been Tested?

Tests currently fail and I'm currently working on that, but I've verified the fix by patching the Mithril dependency manually.

Types of changes

Checklist:

dead-claudia commented 3 years ago

Please do not merge this - let me merge it as I will also need to quickly turn around and cut a release.

pygy commented 3 years ago

Thanks for the fix @isiahmeadows

Edit: I had read your post long ago, and only delved in the code today. I just re-read your initial post that explains what happens.

The loadFromDeps code path was there to let one use the repo as a self test harness (rather than the version in node-modules), to simulate what will happen once the new version is published. It is meant to be triggered manually before publishing, by running the node ./bin/ospec ... rather than npm run test-x. I should have documented this.

You forgot to commit ospec-windows-cmd-workaround (which piques my curiosity) and the windows-dot-bin directory.

At last, why do the CLI tests assertions fail to return a function? That's super weird.

pygy commented 3 years ago

It looks like a better fix for the windows symlink workaround would be to use https://github.com/npm/cmd-shim as a dependency.

dead-claudia commented 3 years ago

You forgot to commit ospec-windows-cmd-workaround (which piques my curiosity) and the windows-dot-bin directory.

🤦 I've updated this PR.

Also closing in favor of #30. Keeping the branch alive, though.