escss-estest
Advanced tools
Comparing version 1.4.20 to 1.4.21
/** | ||
* escss-estest v1.4.20 | ||
* escss-estest v1.4.21 | ||
* (c) 2024 Mike Lee | ||
@@ -83,2 +83,10 @@ * @license AGPL-3.0-only OR Commercial (https://github.com/ESCSS-labs) | ||
function getError(errMsg) { | ||
throw new Error( | ||
` | ||
🚫 Production hides details for security. View them in development. | ||
❗ ${errMsg} | ||
`, | ||
) | ||
} | ||
/** | ||
@@ -91,13 +99,5 @@ * 100% function coverage for easier life. demo: https://demo-estest-log-not-visible.netlify.app/ | ||
function ESTest(input, type, errMsg = 'undefined error message') { | ||
if (process.env.NODE_ENV === 'production') { | ||
throw new Error( | ||
` | ||
🚫 Production hides details for security. View them in development. | ||
❗ ${errMsg} | ||
`, | ||
) | ||
} | ||
else { | ||
// development | ||
if (!TYPES.includes(type)) { | ||
if (!TYPES.includes(type)) { | ||
if (process.env.NODE_ENV === 'production') getError(errMsg) | ||
else { | ||
throw new Error( | ||
@@ -110,3 +110,6 @@ ` | ||
} | ||
else if (!['undefined', 'string'].includes(typeof errMsg)) { | ||
} | ||
else if (!['undefined', 'string'].includes(typeof errMsg)) { | ||
if (process.env.NODE_ENV === 'production') getError(errMsg) | ||
else { | ||
throw new Error( | ||
@@ -119,3 +122,6 @@ ` | ||
} | ||
else if (fixType(input) !== type) { | ||
} | ||
else if (fixType(input) !== type) { | ||
if (process.env.NODE_ENV === 'production') getError(errMsg) | ||
else { | ||
throw new Error( | ||
@@ -129,8 +135,8 @@ ` | ||
} | ||
} | ||
// internal testing purpose | ||
if (process.env.NODE_ENV === 'test') _testToken = type | ||
} | ||
// internal testing purpose | ||
if (process.env.NODE_ENV === 'test') _testToken = type | ||
} | ||
export { _testToken, ESTest } |
{ | ||
"name": "escss-estest", | ||
"version": "1.4.20", | ||
"version": "1.4.21", | ||
"description": "A runtime testing library inspired by TDD and TypeScript to achieve 100% coverage.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9165
142