import createMockFS from "../../fs/mock" ; import tmp from "tmp" ; import Book from "../../models/book" ; import parseBook from "../../parse/parseBook" ; import { generateBook } from "../generateBook" ; param Generator param { Map < String return { Promise < String > } export function generateMockBook ( Generator , files ) { const fs = createMockFS ( files ) ; let book = Book . createForFS ( fs ) ; const dir = tmp . dirSync ( ) ; book = book . setLogLevel ( "disabled" ) ; return parseBook ( book ) . then ( ( resultBook ) => { return generateBook ( Generator , resultBook , { root : dir . name , } ) ; } ) . then ( ( output ) => { return { book , output , dir : dir . name , } ; } ) ; } param Generator param { Map < String return { Promise < String > } function generateMock ( Generator , files ) { return generateMockBook ( Generator , files ) . then ( ( ret ) => ret . dir ) ; } export default generateMock ;