Skip to content

Releases: rtfeldman/node-test-runner

0.19.2-1

Choose a tag to compare

@lydell lydell released this 21 Aug 20:44
57c44ba

This release adds a few CLI options, reduces the dependency footprint, and fixes a bug.

Added

This release adds a few CLI options that elm-test-rs already has:

  • --workers for choosing how many workers elm-test should use to run tests in parallel. Use --workers 1 to run tests single-threaded.
  • --dependencies oldest for Elm package developers.
  • --offline for making sure elm-test makes no HTTP requests.

Performance

This release removes a bunch of dependencies. Including dependencies of dependencies, elm-test went from 31 to 23 dependencies, and about half a megabyte less stuff to install!

These direct dependencies were removed, in case you are curious (or run into regressions):

  • cross-spawn: This was used to make spawning the Elm compiler work reliably on Windows. That package is made to work for any situation you could imagine, but we can take advantage of the fact that the only subprocess we are spawning is the Elm compiler. We now use the Node.js builtin child_process.spawn function instead, with shell: true for Windows. Executing using a shell (cmd.exe) is needed when you install Elm using npm, which uses a batch script to call elm.exe (and works when you have installed elm.exe directly, too). Using shell requires escaping all arguments passed to elm.exe. Here we can take advantage of that we know that the only dynamic arguments are going to be file paths. File paths on Windows cannot contain ", which makes escaping using quoting much easier. This way we don’t need a full escaping solution like cross-spawn has. Testing on Windows shows that the new approach should work just as well as cross-spawn, but do let us know if you run into any issues!

  • xmlbuilder: This was used to generate XML for --report junit. elm-test now has its own implementation of the small part of that library that was actually used. We took inspiration from xmlbuilder when it comes to escaping characters for XML. The output should be equivalent, but stuff like this is always tricky so there’s of course a small risk of regressions.

  • graceful-fs: This was used when elm-test was looking for exposed test values in modules. elm-test used to read the files asynchronously, and when you do that there’s the risk that you try to open more files at once than the OS allows. graceful-fs made sure that didn’t happen. elm-test now reads the files synchronously instead, making sure that just one file is open at a time. As a bonus this is up to 2 times faster, due to less overhead!

  • split: This was used to split messages streamed from workers into newline delimited lines. elm-test now uses Node.js’ builtin readline module instead.

Fixed

  • If you print something big to the terminal and then call process.exit(0) in Node.js, there is a risk that Node.js does not have time to print everything before exiting. This happened especially with --report json and large test suites. This caused tests to be marked as “Terminated” instead of “Passed” in intellij-elm since the plugin never received messages that tests finished and passed. elm-test now sets the exit code using process.exitCode = 0 instead, and lets Node.js exit by itself when it has run out of things to do. This required explicitly shutting down some things, which otherwise kept the process running forever without the explicit process.exit call. elm-test only uses this approach in the “happy path” where it knows that stuff has been shut down properly, but there is of course a risk of regressions. If you run into a situation where elm-test never exits, please let us know!

0.19.2-0

Choose a tag to compare

@lydell lydell released this 06 Jul 18:06
9c7d5ba

Breaking

elm-test now requires Elm 0.19.2!

Note that if you install Elm 0.19.2, but forget to update elm-test, you’ll get an error like this:

-- ELM VERSION MISMATCH ----------------------------------------------- elm.json

Your elm.json says this application needs a different version of Elm.

It requires 0.19.1, but you are using 0.19.2 right now.


`elm make` failed with exit code 1.

That error message is slightly confusing because it’s talking about a generated elm.json file deep in the elm-stuff/ directory, not your own elm.json! But either way, the solution is to use the same version of elm and elm-test. See Versions for details.

Thanks to Harm for helping with this!

Performance

  • elm-test no longer depends on the chalk package. Jeroen Engels noticed that all we used that package for was to color text blue and red, and made a PR simplifying that to just two functions (and a helper), instead of a whole package – with sub-dependencies. This removed 6 npm packages in total, and about 0.2 MB, from an elm-test install!

  • elm-test now starts up to ~40 ms faster in some cases, due to lazy loading of two npm packages. When not using the watch mode, or when not using the junit report, we now avoid loading a bunch of file watching and XML generating code. Thanks to Jeroen Engels for doing deep analysis on this!

  • When Expect.equal fails on two large, dissimilar strings, the reporter's character-level diff takes several seconds – just to realize that a diff cannot be displayed. Matthieu Pizenberg fixed this in elm-test-rs, which originally copied the code in question from this repo. The fix has now been copied back, so diffs stay sub-second, even for really large cases!

0.19.1-revision17

Choose a tag to compare

@lydell lydell released this 18 Nov 09:36
2666e9a

Fixed

When running tests, elm-test needs to merge "dependencies" and "test-dependencies" in your elm.json. To do this, elm-test uses elm-solve-deps.

Previously, this merging step could result in ignoring the "indirect" parts of dependencies in elm.json, and getting a later (but still semver compatible) version instead. For example, you might have had "elm/virtual-dom": "1.0.4" in "indirect" in elm.json, but ended up getting 1.0.5 installed in tests.

Now, elm-test prefers the version mentioned in "indirect" if possible, so that you end up getting the same code in your source code and in tests.

See issue 652 for more details.

Thanks to Juliano Solanho for reporting and fixing!

0.19.1-revision16

Choose a tag to compare

@lydell lydell released this 06 Jul 15:08
1f19768

Fixed

elm-test now works with an upcoming version of the Lamdera compiler. Lamdera has a cool new optimization, that unfortunately made elm-test unable to find tests. Now that is fixed! Thanks to Leonardo Taglialegne!

0.19.1-revision15

Choose a tag to compare

@lydell lydell released this 15 Feb 23:42

Fixed

This version replaces the glob dependency with tinyglobby, which is used by elm-review, and many other popular projects. This has a couple of benefits:

  • Restores the Node.js 12 support lost in 0.19.1-revision13.
  • Fixes globs that resolve to directories on Windows. Regression since 0.19.1-revision13, due to the glob upgrade. The test suite was previously missing coverage for this.
  • tinyglobby is much smaller than glob, reducing the installation size and number of indirect dependencies.

Thanks to Jeroen Engels for making the pull request fixing this, and to @lishaduck for introducing tinyglobby to elm-review and suggesting elm-test should use it too!

0.19.1-revision14

Choose a tag to compare

@lydell lydell released this 15 Feb 09:46

Fixed

0.19.1-revision13 unfortunately did not work out of the box in Node.js 12–18 due to a bug in npm versions older than v10. This version is a quick-fix that restores support for Node.js 14–18, while still not causing deprecation warnings. Thanks to @lishaduck for reporting!

Unfortunately, Node.js 12 is still broken. You need to stay on 0.19.1-revision12 if you use Node.js 12.

(For those interested, the fix was changing the glob version range to ^8.0.3 to ^8.0.3 || ^9.0.0 || ^10.0.0. ^11.0.0 was removed from it due to the linked npm bug.)

0.19.1-revision13

Choose a tag to compare

@lydell lydell released this 14 Feb 22:12
8ef89c8

Fixed

  • elm-test no longer fails with an error about duplicate source directories if your elm.json contains "source-directories": ["tests"].
  • The glob dependency version has been updated from ^8.0.3 to ^8.0.3 || ^9.0.0 || ^10.0.0 || ^11.0.0. This allows npm (or your package manager of choice) to install the latest version of glob that works with your Node.js version. Versions 8 and 9 are deprecated. If you use Node.js 16 or later, this allows you to get rid of deprecation warnings.
  • The elm-solve-deps-wasm dependency version has been updated from ^1.0.2 to ^1.0.2 || ^2.0.0, which is the same version constraint that elm-review 2.13.0 uses. If you install the latest version of both elm-test and elm-review, you only get one copy of elm-solve-deps-wasm in node_modules/ instead of two, saving about 288 KB.

0.19.1-revision12

Choose a tag to compare

@lydell lydell released this 16 Feb 18:28
59a8666

Fixed

  • elm-test --report junit now works with elm-program-test. The junit report is XML. elm-program-test uses some characters that are not allowed in XML. This version replaces such disallowed characters with an Elm-style escape sequence, instead of crashing like it did before. Thanks to Christoph Hermann for reporting and to Ilias Van Peer for fixing!

0.19.1-revision11

Choose a tag to compare

@lydell lydell released this 02 Jan 19:50
9c4ffdc

Fixed

  • elm-test init now prints a working link to the elm-explorations/test package. Thanks to Max Strübing!
  • If you ever saw RuntimeError: unreachable when trying to use elm-test, that should not be possible to happen anymore. elm-test now depends on the latest version of elm-solve-deps-wasm which solved that problem. (Previously, you had to make sure you had that version installed yourself).

0.19.1-revision10

Choose a tag to compare

@lydell lydell released this 11 Oct 20:46
dc3ac90

⚠️ Updating to this version also requires upgrading to the just released elm-explorations/test 2.0.0!

Breaking

  • This version of elm-test only works with elm-explorations/test 2.x (2.0.0 <= v < 3.0.0), which was just released. The versions table should make it clear which versions work together.

  • Removed elm-test install-unstable-test-master and elm-test uninstall-unstable-test-master. They are no longer needed since elm-explorations/test 2.0.0 has been released.

Added

  • Fuzzer distribution statistics report. Fuzzer distribution is new in elm-explorations/test 2.0.0, and it required a change in how things are reported from Elm to the test runner, which is why elm-test 0.19.1-revision10 is not compatible with older elm-explorations/test versions.

  • The --no-clear-console flag. By default, elm-test --watch clears the screen on every re-run, so you only see up-to-date output. With --no-clear-console, the console is not cleared and a separator is instead printed between the old and new output instead (similar to how elm-test-rs works). This is useful if you are running several commands in the same terminal and don’t want elm-test --watch to clear away output from other commands.