Skip to content

Commit

Permalink
Remove todo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stoeffel committed Jan 17, 2024
1 parent d6e9d8d commit 882b40d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 39 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 6.0.2

- Remove creating empty "todo" tests when a module doesn't have any examples.

## 6.0.1

- Move elm-test to dev-dependencies.
Expand Down
2 changes: 0 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

PASSED_COUNT=35
FAILED_COUNT=5
TODO_COUNT=1

pushd example
# Push test output into a file, dropping all color codes in the process.
Expand All @@ -11,5 +10,4 @@ popd
set -euo pipefail
cat output.txt | grep "Passed" | grep "${PASSED_COUNT}"
cat output.txt | grep "Failed" | grep "${FAILED_COUNT}"
cat output.txt | grep "Todo" | grep "${TODO_COUNT}"
npx elm-test
19 changes: 6 additions & 13 deletions src/VerifyExamples.elm
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,12 @@ generateTests tests =


compileElm : ElmSource -> Elm.Parsed -> ( List Warning, List Compiler.Result )
compileElm { moduleName, fileText, ignoredWarnings } parsed =
case parsed.testSuites of
[] ->
( []
, [ Compiler.todoSpec moduleName ]
)

_ ->
( Warning.warnings ignoredWarnings parsed
, List.concatMap
(Elm.compile moduleName)
parsed.testSuites
)
compileElm { moduleName, ignoredWarnings } parsed =
( Warning.warnings ignoredWarnings parsed
, List.concatMap
(Elm.compile moduleName)
parsed.testSuites
)


reportWarnings : ModuleName -> List Warning -> Cmd msg
Expand Down
25 changes: 1 addition & 24 deletions src/VerifyExamples/Compiler.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module VerifyExamples.Compiler exposing (Result, compile, todoSpec)
module VerifyExamples.Compiler exposing (Result, compile)

import String
import String.Util exposing (escape, indent, indentLines, unlines)
Expand All @@ -25,29 +25,6 @@ compile nomenclature suite =
suite.tests


todoSpec : ModuleName -> Result
todoSpec moduleName =
( moduleName
, unlines
[ "module VerifyExamples." ++ ModuleName.toString moduleName ++ " exposing (..)"
, ""
, "-- This file got generated by [elm-verify-examples](https://github.com/stoeffel/elm-verify-examples)."
, "-- Please don't modify this file by hand!"
, ""
, "import Test"
, "import Expect"
, ""
, ""
, "spec : Test.Test"
, "spec ="
, indent 1 <|
"Test.todo \"module "
++ ModuleName.toString moduleName
++ ": No examples to verify yet!\""
]
)


compileTest : Nomenclature -> TestSuite -> Int -> Test -> Result
compileTest nomenclature suite index test =
let
Expand Down

0 comments on commit 882b40d

Please sign in to comment.