'use strict' ; import assert from 'power-assert' ; import { prepareLuaTest } from '../LuaTestUtil' ; describe ( 'auto_merge component' , ( ) => { let luaVmWrapper ; before ( async ( ) => { luaVmWrapper = await prepareLuaTest ( __dirname , { customConfig : { approve : { version : 1 , label : 'pull/approved' , command : '/approve' , } , } , injectMap : new Map ( ) . set ( 'getData' , ( ) => ( { pulls : [ { number : 1 , labels : [ 'pull/approved' , ] , closedAt : null , } , ] , } ) ) , } ) ; } ) ; afterEach ( ( ) => { luaVmWrapper . clean ( ) ; } ) ; describe ( 'auto merge' , ( ) => { it ( 'auto merge' , async ( ) => { const result = luaVmWrapper . invoke ( 'Auto merge' ) ; assert . deepStrictEqual ( result , [ [ 'merge' , 1 ] , ] ) ; } ) ; } ) ; } ) ;