File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable space-before-function-paren */
22/* eslint-disable no-control-regex */
3+ import { getPercent } from '../utils/support.mjs'
34const stripAnsi = ( str ) => str . replace ( / ( \x1b | \u001b ) \[ \d + (?: ; \d + ) * m / g, '' )
45
56const escapeHtml = ( str ) => {
@@ -28,7 +29,7 @@ export const template = ({
2829 numTodo = 0 ,
2930 results,
3031} ) => {
31- const percent = ( v ) => ( numTests === 0 ? 0 : Math . round ( ( v / numTests ) * 100 ) )
32+ const percent = ( count ) => getPercent ( count , numTests )
3233
3334 return `
3435<!DOCTYPE html>
Original file line number Diff line number Diff line change 11export const timeStamp = ( ) => Date . now ( )
2+ export const getPercent = ( count , total ) =>
3+ total === 0 ? 0 : Math . round ( ( count / total ) * 100 )
You can’t perform that action at this time.
0 commit comments