import * as assert from 'assert' ; export default class AssertUtils { public static typedArraysAreEqual ( left , right , size ? ) { if ( ! size ) { size = Math . max ( left . length , right . length ) ; } for ( let i = 0 ; i < size ; i ++ ) { if ( left [ i ] !== right [ i ] ) { return false ; } } return true ; } } export const assertEquals = < T > ( actual , expected , message ? ) => assert . strictEqual ( actual , expected , message ) ; export const assertArrayEquals = ( a , b ) => assert . deepStrictEqual ( a , b ) ; export const assertFalse = x => assert . strictEqual ( ! ! x , false ) ; export const assertTrue = x => assert . strictEqual ( ! ! x , true ) ; export const assertNull = x => assert . strictEqual ( x , null ) ; export const assertNotNull = x => assert . notStrictEqual ( x , null ) ; export const assertThrow = ( func , err ) => assert . throws ( func , err ) ;