gitawego / mower-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mower test

usage

import { Lawn } from './Lawn';
Lawn.schedule(your_script).run();

events: change, warn

const lawn = Lawn.schedule(your_script);
lawn.on('change',(evt)=>{
	console.log(evt.mower);
	// you can get curent position
	console.log(evt.mower.getPosition());
	console.log(evt.data);
});
lawn.on('warn',(evt)=>{
	console.log(evt.warning);
	console.log(evt.mower);
});
lawn.run();

how to test

install dependencies

# if you use yarn
yarn
# otherwise
npm install

test

# test code
yarn test

# coverage
yarn coverage

About


Languages

Language:TypeScript 92.5%Language:JavaScript 7.5%