nl_tokens: Middleware for serving es modules . Karma doesn t serve any files not specified beforehand . This is extremely inconvenient when working with es modules as many files are requested on the fly .
pl_tokens: function getCode ( filePath ) { // take code from cache if available const cachedCode = esm . compiler . getCached ( filePath ) ; if ( cachedCode ) { return cachedCode ; } if ( ! fs . existsSync ( filePath ) ) { throw new Error ( ` ${ filePath } ` ) ; } // otherwise read code from file and compile it const <mask> = fs . readFileSync ( filePath , 'utf-8' ) ; return esm . compiler . compile ( filePath , code ) ; }