Skip to content

Commit

Permalink
feat: enable coverage through EXODUS_TEST_COVERAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
sparten11740 committed Sep 16, 2024
1 parent 765bb8f commit 2dd1139
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import assert from 'node:assert/strict'
import { Queue } from '@chalker/queue'
import glob from 'fast-glob'
import { haveModuleMocks, haveSnapshots, haveForceExit } from '../src/version.js'
import { isTruthy } from '../src/env.js'

const bindir = dirname(fileURLToPath(import.meta.url))
const DEFAULT_PATTERNS = [`**/?(*.)+(spec|test).?([cm])[jt]s?(x)`] // do not trust magic dirs by default
Expand Down Expand Up @@ -42,7 +43,7 @@ function parseOptions() {
flow: false,
esbuild: false,
babel: false,
coverage: false,
coverage: isTruthy(process.env.EXODUS_TEST_COVERAGE),
coverageEngine: 'c8', // c8 or node
watch: false,
only: false,
Expand Down
5 changes: 5 additions & 0 deletions src/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const truthy = new Set(['true', '1', 'yes', 'y', 'on'])

export function isTruthy(envVar) {
return truthy.has(envVar)
}

0 comments on commit 2dd1139

Please sign in to comment.