Notable changes to this project will be documented in this file.
The format is based on Keep a Changelog. This project mirrors the Elm version. So version 0.19.1-revisionX of this project will be compatible with Elm 0.19.1.
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!
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!
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
globupgrade. The test suite was previously missing coverage for this. tinyglobbyis much smaller thanglob, 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-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.)
- elm-test no longer fails with an error about duplicate source directories if your
elm.jsoncontains"source-directories": ["tests"]. - The
globdependency version has been updated from^8.0.3to^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 ofglobthat 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-wasmdependency version has been updated from^1.0.2to^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 innode_modules/instead of two, saving about 288 KB.
elm-test --report junitnow works with elm-program-test. Thejunitreport is XML.elm-program-testuses 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!
elm-test initnow prints a working link to theelm-explorations/testpackage. Thanks to Max Strübing!- If you ever saw
RuntimeError: unreachablewhen trying to useelm-test, that should not be possible to happen anymore. elm-test now depends on the latest version ofelm-solve-deps-wasmwhich solved that problem. (Previously, you had to make sure you had that version installed yourself).
-
This version of
elm-testonly 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-masterandelm-test uninstall-unstable-test-master. They are no longer needed since elm-explorations/test 2.0.0 has been released.
-
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-consoleflag. By default,elm-test --watchclears 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 wantelm-test --watchto clear away output from other commands.
elm-test install-unstable-test-master(added in the previous version) now works with packages.
- Removed support for Node.js 10 (which reached end of life 2021-04-30). Node.js 12.20.0 is now the minimum supported Node.js version. (Node.js 12 actually reached end of life 2022-04-30, but we decided to keep support for it for a while longer since there was no need of dropping it right now.)
elm-test install-unstable-test-master- which installs the
masterversion of theelm-explorations/testlibrary in place of the1.2.2version in yourELM_HOME
- which installs the
elm-test uninstall-unstable-test-master- which undoes that
This let’s you test the upcoming major version of elm-explorations/test. Big thanks to Martin Janiczek!
-
elm-test no longer uses elm-json to calculate the set of dependencies needed to run your tests. Instead, we use elm-solve-deps-wasm which basically is a WebAssembly port of the dependency solver in elm-test-rs. Big thanks to Matthieu Pizenberg! Benefits of this change:
- elm-test no longer needs to download the elm-json binary at install time or run time. elm-solve-deps-wasm is a regular, cross platform npm package.
- Improves compatibility with Lamdera.
- elm-solve-deps-wasm works offline to a greater extent than elm-json. Many times it doesn’t need to make any calls to package.elm-lang.org at all!
-
elm-test now shows suggestions on misspelled CLI flags.
- If you have
module MyTest exposing (..)with the expose-all(..)and a char literal with a unicode escape, like'\u{000D}', in the same file, elm-test now correctly finds all tests to run in that file. A bug with unicode escape parsing previously caused no tests to be found.
- elm-test now works if you have
{ "type": "module" }in your package.json. --output=/dev/nullis now ignored. This is needed by Emacs’ flycheck-elm package, which calls bothelm makeandelm-test makewith--output=/dev/null.elm-test makedoes not produce any output files, so the flag doesn’t change anything. (Before 0.19.1-revision5, all unknown flags were silently ignored.)- The “no tests found” error message now works with
--report=jsonand--report=junitagain (regression in 0.19.1-revision5). - Better error message for
--fuzz=0.
- The
--no-colorand--colorflags (to disable and force colors) now work again (regression in 0.19.1-revision5). --no-colornow turns off colors in Elm compiler error messages as well.
- Removed support for Node.js 8 (which reached end of life 2019-12-31). Node.js 10.13.0 is now the minimum supported Node.js version.
- Removed the undocumented
--verboseflag. It didn’t do much at all in its current state.
- Now works on Apple Silicon/M1/ARM MacBooks. Installation used to fail with “Error: No binaries are available for your platform: darwin-arm64.”
- You can now run your test from a subdirectory.
elm-testfinds yourelm.jsonup the directory tree instead of printing an error. - If you had a port named
sendorreceiveand they were reached via test cases,elm-testused to fail with a duplicate port error.elm-testhas renamed its internal ports so that conflicts are very unlikely. - The JUnit reporter now says
@failuresinstead of@failedwhich makes Jenkins happier. elm-testnow errors on unknown (misspelled) flags instead of silently ignoring them.elm-testnow errors on bad--fuzzand--seedvalues instead of silently ignoring them.- A whole host of Elm package dependencies errors, by using
elm-jsonto calculate the set of dependencies needed to run your tests. elm-test --watchno longer crashes if for packages if there are compilation errors insrc/at startup.elm-test --watchnow detects changes in yourelm.json.elm-test --watchnow works better when lots of files change at once. If 10 files changed, your tests used to run 10 times in sequence (more or less). Now, they only run once or twice. Changes within 100 ms are batched together. Changes happening while the tests are running no longer queue up – they instead trigger one single test once the current run is done.- Compilation errors are no longer hidden by a super long “Compilation failed while attempting to build [absolute paths to every single test Elm file]” message.
- A bunch of checks and validations have been added to help in edge cases.
elm-testis now faster to install (by having fewer dependencies). It used to be around 18 MB, now it’s just 2 MB.elm-testnow runs about half a second faster, by no longer usingelmi-to-json. (As a bonus, if you ever encountered errors mentioningelmi-to-json, that won’t happen anymore.)elm-test --watchnow reruns your tests sooner after file changes (about 100 ms after the changes, instead of about 500 ms).
- The
--helpoutput is now more conventional and hopefully easier to read.
- The
--compilercommand line flag now correctly finds elm executables on your PATH (see #438). - We have hugely slimmed down the reproduction instructions so that the test runner no longer prints hundreds of test file paths to the console (see issue #431 and fix #432).
- A whole host of spring cleaning that streamlines the test runner. (see #425).
- Update elmi-to-json and use
--for-elm-testto optimise collection of tests (#396).
- drop support for elm 0.19.0
elm-test --helpnow exits with code0.
elm-testsupports elm 0.19.1.- Node 12.
npm auditcomplaints on versions of chokidar and node-elm-compiler
- Excessive small highlights in some diffs (#263)
- Upgraded to a version of lodash with a vulnerability fixed.
elm-test install PACKAGE- works likeelm installbut installs intotest-dependencies
--add-dependencies(replaced byelm-test install)- CLI aliases (e.g.
-fas a shorthand for--fuzz).
- Low-contrast diff color (#229)
- Socket write edge case (#228)
- Invalid JUnit XML (#218)
- Potentially fixed: elm-test hanging
- Run tests in parallel (#45)
--watcherror reporting (#192)--watchpotential extra compile processes (#194)
- More accurate timetracking
- Use symlinks to improve generated code performance
- Use Elm instead of Chalk for colored console output
- Use Prettier
- All reporters were considered "machine readable", resulting in the error stream being ignored (#161)
- We have a changelog! (#151)
- Proper error messages when username or repository name contains dots (#166)
- Add flow type annotations to prevent silly JS mistakes! (#162)
- Imports in the
Example.elmfile are now sorted for compatibility withelm-format@exp
--reportflag broken (#155)
- If your project depends on
elm-lang/html,elm-test initwill add a dependency toeeue56/elm-html-testso you can test your HTML. (#154)
- Runner no longer fails when CWD has spaces in it (#147)
- Tests that are
port modulesoreffect modulesare no longer rejected (#143)
--add-dependencies target/elm-package.jsonflag to add any missing dependencies from theelm-package.jsonfile in the current director to thetarget/elm-package.jsonfile. (#28)Test.todoto mark tests as not yet implemented. (#104)--fuzzflag to override the default fuzz count. (#77)Test.onlyandTest.skipto limit which tests will be executed.
elm-test initnow adds all dependencies from the packageelm-package.jsonto the generatedtests/elm-package.jsonfile. (#68)- You no longer write a
tests/Main.elmfile. Rather, you pass the paths to your tests to theelm-testexecutable to run just those files, or you runelm-testwithout arguments which will look for all elm files undertests/andtest/. (#72) - All exposed values of type
Testare executed by the test-runner. - Duplicate titles/descriptions fail the test run. (#115)
- Empty describes are no longer allowed. (#95)
- Ignores
elm-stuff(#100) - Tests that throw a runtime exception fail with the exception message as failure, rather than crashing the runner. (#69)
- Upgrade the runner
npm i -g elm-test - Remove
tests/Main.elm - Remove the dependency on
rtfeldman/node-test-runnerfromtests/elm-package.json - Bump the dependency on
elm-community/elm-testto4.2.0 <= v < 5.0.0intests/elm-package.json - Ensure your test files expose each test you want to run, and that those values are of type
Test - Make sure those tests aren't defined twice (for example: once as a top-level value, and again in a
describeblock) or they will be executed twice. - run
elm-testto execute your tests.