Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove Example ran successful message #69

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ const plus5 = Fae.add(5)
console.assert(plus5(3) === 8)
console.assert(plus5(-7) === -2)
console.assert(plus5(0) === 5)

console.log('Example ran successfully')
2 changes: 0 additions & 2 deletions examples/and.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ const andWithTruthyValue = Fae.and(2)
console.assert(andWithTruthyValue(true) === true)
console.assert(andWithTruthyValue('ab') === true)
console.assert(andWithTruthyValue(2) === true)

console.log('Example ran successfully')
2 changes: 0 additions & 2 deletions examples/both.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ const oddGreaterThan5 = Fae.both(isOdd, isGreaterThan5)
console.assert(isBetween5And13(12) === true)
console.assert(oddLessThan1(3) === false)
console.assert(oddGreaterThan5(21) === true)

console.log('Example ran successfully')
2 changes: 0 additions & 2 deletions examples/either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ const oddOrLessThan1 = Fae.either(isOdd, isLessThan1)
console.assert(is5OrLessThan13(12) === true)
console.assert(isOddOrEquals5(4) === false)
console.assert(oddOrLessThan1(21) === true)

console.log('Example ran successfully')
2 changes: 0 additions & 2 deletions examples/flip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ import * as Fae from 'https://deno.land/x/fae/mod.ts'

// TODO
console.assert(1 === 1)

console.log('Example ran successfully')
2 changes: 0 additions & 2 deletions examples/not.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ console.assert(Fae.not(true) === false)
console.assert(Fae.not('ab') === false)
console.assert(Fae.not([1, 2]) === false)
console.assert(Fae.not({ a: 1, b: 3 }) === false)

console.log('Example ran successfully')
8 changes: 4 additions & 4 deletions run-utils/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
italic,
red,
yellow,
underline,
} from 'https://deno.land/[email protected]/fmt/colors.ts'

const examples: Deno.DirEntry[] = []
Expand Down Expand Up @@ -54,10 +55,11 @@ if (nonZeroExamples.length) {
const name = functionNameForLog(e.name)
const errorCode = red(e.status.code.toString())

return `${name}- ${errorCode}`
return `${name} ${errorCode}`
})
.join('\n')

console.error(underline(red('Some or all examples failed with status codes-\n')))
console.error(statusInfo)
Deno.exit(1)
}
Expand All @@ -79,9 +81,7 @@ const outputs = await Promise.all(
)

const nonEmptyOutputExamples = outputs.filter(
({ output, error }) =>
output.trim() !== 'Example ran successfully' ||
error.includes('Assertion failed'),
({ error }) => error.includes('Assertion failed'),
)

if (nonEmptyOutputExamples.length) {
Expand Down