From 882b40db01c05a47e3e47e1aff654b61e6582a2f Mon Sep 17 00:00:00 2001 From: Stoeffel Date: Wed, 17 Jan 2024 14:42:56 +0100 Subject: [PATCH] Remove todo tests --- CHANGELOG.md | 4 ++++ run-tests.sh | 2 -- src/VerifyExamples.elm | 19 ++++++------------- src/VerifyExamples/Compiler.elm | 25 +------------------------ 4 files changed, 11 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d99daca..5f128e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/run-tests.sh b/run-tests.sh index 8c5ab5c..06171fd 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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. @@ -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 diff --git a/src/VerifyExamples.elm b/src/VerifyExamples.elm index f4446cb..0e10f7e 100644 --- a/src/VerifyExamples.elm +++ b/src/VerifyExamples.elm @@ -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 diff --git a/src/VerifyExamples/Compiler.elm b/src/VerifyExamples/Compiler.elm index bb69d9d..e1b53c9 100644 --- a/src/VerifyExamples/Compiler.elm +++ b/src/VerifyExamples/Compiler.elm @@ -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) @@ -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