Skip to content

Commit 2b5dec4

Browse files
Fix no test found message (#7)
* Fix no test found message * add entry to changelog
1 parent 40560ac commit 2b5dec4

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased Changes
44

5+
* fix error message when no tests are found ([#7](https://github.com/jsdotlua/jest-lua/pull/7))
6+
57
## 3.6.1 (2024-01-16)
68
* Re-release of 3.6.0 with widened promise dependency that includes older versions for maximum flexibility ([#378](https://github.com/Roblox/jest-roblox-internal/pull/378))
79

src/jest-core/src/runJest.lua

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,11 @@ local function runJest(ref: {
318318
local hasTests = #allTests > 0
319319

320320
if not hasTests then
321-
local noTestsFoundMessage = getNoTestsFoundMessage(testRunData, globalConfig)
322-
323-
if
324-
globalConfig.passWithNoTests
325-
-- ROBLOX deviation START: not supported
326-
-- or globalConfig.findRelatedTests
327-
-- or globalConfig.lastCommit
328-
-- or globalConfig.onlyChanged
329-
-- ROBLOX deviation END
330-
then
321+
local noTestsFound = getNoTestsFoundMessage(testRunData, globalConfig)
322+
local exitWith0 = noTestsFound.exitWith0
323+
local noTestsFoundMessage = noTestsFound.message
324+
325+
if exitWith0 then
331326
CustomConsole.new(outputStream, outputStream):log(noTestsFoundMessage)
332327
else
333328
CustomConsole.new(outputStream, outputStream):error(noTestsFoundMessage)

0 commit comments

Comments
 (0)