Comments (8)
Update: this is fixed on a branch; will be included with the next release!
from node-test-runner.
Seems to be an issue with elm-make, added some details at https://github.com/opsb/elm-test-crash#elm-make-scenarios
from node-test-runner.
+1
I spent some quality time identifying this one today.
module Tests exposing (..)
import Test exposing (..)
import Expect
import String
crashingFunction = "blah" |> Debug.crash
all : Test
all =
describe "A Test Suite"
[ test "This will crash" <|
\() ->
Expect.equal crashingFunction "blah"
]
from node-test-runner.
@sjfloat nice work isolating that!
from node-test-runner.
Sure. At least I know what to suspect now if I get that behavior in a test.
Thanks for discovering it in the first place!
ᐧ
On Thu, Sep 22, 2016 at 9:56 AM, Oliver Searle-Barnes <
[email protected]> wrote:
@sjfloat https://github.com/sjfloat nice work isolating that!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#69 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AANMZ65H5LENpWFa97BzcUfDcYTbXpeWks5qsokegaJpZM4Jyv5k
.
"I have delusions of grandeur. I believe myself to be Steve Jones"
from node-test-runner.
As a workaround, you can explicitly put a Debug.log
as well as a Debug.crash
, in which case it gets displayed in the elm-test
output. For example, this is a function I often use in my tests:
unsafeDecodeString : Decoder a -> String -> a
unsafeDecodeString decoder json =
let
result =
JD.decodeString decoder json
in
case result of
Ok r ->
r
Err str ->
str
|> Debug.log "unsafeDecodeString"
|> Debug.crash "unsafeDecodeString"
This will give output like:
success! Compiled 4 modules.
Successfully generated /var/folders/26/cpffj2js733d5kmk6m9w0n840000gn/T/elm_test_1161030-50093-jeoo8k.1g33c2qpvi.js
unsafeDecodeString: "Expecting an object with a field named `id` but instead got: {\"hello\":\"Dave\"}"
from node-test-runner.
I have used Debug.log in a fuzztest to sample the data to see if it is generating the data I want
from node-test-runner.
Just want to note that this is on my radar, and the plan is for any exception in a test to result in a failure with a message reporting the exception. It's nontrivial to implement but definitely doable.
(Adding something like Expect.crashes : (a -> b) -> Expectation
also seems doable, but I'd want to consider that separately as a feature.)
from node-test-runner.
Related Issues (20)
- Implement test filtering HOT 2
- Detect when we run tests twice
- Crash when --output is set for `elm-test make` HOT 8
- Unable to install npm package for 0.18.13-beta4 HOT 12
- Erroneously requires indirect dependencies specified for packages during watch HOT 3
- node 10 is eol
- No output for successful test runs HOT 4
- 0.19.1-revision8 Changelog HOT 1
- Running elm-test leaves fish shell in a weird state HOT 3
- Implicitly exposed tests not found if test module contains a character literal with a unicode sequence HOT 1
- Allow running just non-fuzzed tests HOT 1
- Check if the file read/write in the dependency cache can cause issues in the solver HOT 2
- elm-test doesn't work with Yarn 2 HOT 3
- Junit reporter breaks with new error messages of elm-program-test HOT 2
- RuntimeError: unreachable HOT 14
- Print statistics/progress on signal SIGUSR1 (Linux) / SIGINFO (macOS) HOT 1
- Support --watch for "elm-test make"
- Better support for long running tests
- from 0.19.1-revision2 to 0.19.1-revision7 (btu same with 9 and 12) skip some tests running HOT 7
- Mocha tests fail on modern Node versions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-test-runner.