import assert = require ( "assert" ) ; export async function assertThrows ( testfunc ) { try { await testfunc ( ) ; } catch { return ; } assert . fail ( ) ; } export async function assertThrowsWithMessage ( testfunc , message ) { try { await testfunc ( ) ; } catch ( error ) { assert ( error . toString ( ) . includes ( message ) ) ; return ; } assert . fail ( ) ; } export function splitString ( value , separator , limit ) { const arr = value . split ( separator ) ; return arr . slice ( 0 , limit ) . concat ( arr . slice ( limit ) . join ( separator ) ) ; }