![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
eunit-runner
Advanced tools
Minimalistic unit testing framework for Elm.
In the root directory of an Elm project:
elm-package install eunit
to install the eunit
Elm packagenpm install -g eunit-runner
to install the command line test runnerTo generate a test example run eunit init
in the root directory of an Elm project to which tests should be added.
Test example should be created in test/Main.elm
import Expectation exposing (eql, isTrue)
import Test exposing (it, describe, Test)
import Runner exposing (runAll)
import Html exposing (Html)
all : Test
all = describe "Arithmetic operations"
[ describe "Addition"
[ it "should add two positive numbers" <|
eql (1 + 2) 3
, it "should be commutative" <|
eql (1 + 2) (2 + 1)
, it "should be associative" <|
eql ((1 + 2) + 3) (1 + (2 + 3))
]
, describe "Multiplication"
[
it "should multiply two positive numbers" <|
eql (2 * 3) 6
, it "should be commutative" <|
eql (2 * 3) (3 * 2)
, it "should be associative" <|
eql ((2 * 3) * 4) (2 * (3 * 4))
]
, describe "Subtraction"
[
it "should subtract two numbers" <|
eql (2 - 3) -1
, it "should be commutative?" <| -- Failing test, subtraction is not commutative!
eql (2 - 3) (3 - 2)
, it "should be associative?" <| -- Failing test, subtraction is not associative!
isTrue (((2 - 3) - 4) == (2 - (3 - 4)))
]
]
main : Html msg
main =
runAll all
Test structure should be self-explanatory, it is inspired largely by Jasmine. Some differences:
it
can have only one expectationeql
, isTrue
, isFalse
beforeEach
and afterEach
as tests are written for stateless functions and do not require setting up shared stateTests can be simply run in browser, just start elm-reactor in the root directory of the project and access test/Main.elm
. Running tests in a browser can be a good way to debug a particular test failure.
Make sure that eunit-runner
NPM package is installed globally, run eunit
in the root directory of the project.
You should get an output like the following one:
EUnit test runner
Running test suite...
Arithmetic operations
.......xx
Elapsed time: 500ms
Passed: 7
FAILED: 2
To debug run 'elm-reactor -p 9908 ' and open http://localhost:9908/test/Main.elm in a browser for more details.
FAQs
Runner for eunit Elm unit tests
The npm package eunit-runner receives a total of 1 weekly downloads. As such, eunit-runner popularity was classified as not popular.
We found that eunit-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.