license fileoverview import * as fs from 'fs' ; import { FileCache } from './cache' ; export function writeTempFile ( name , contents ) { const fn = ( process . env [ 'TEST_TMPDIR' ] || '/tmp' ) + '/tmp.' + ( Math . random ( ) * 1000000 ) . toFixed ( 0 ) + '.' + name ; fs . writeFileSync ( fn , contents ) ; return fn ; } let digestNumber = 0 ; export function invalidateFileCache ( fc , ... fileNames ) { const digests = new Map < string , string > ( ) ; for ( const fp of fileNames ) { digestNumber ++ ; digests . set ( fp , `${ fp }${ digestNumber }` ) ; } fc . updateCache ( digests ) ; }