{"id":19425563,"url":"https://github.com/botmasterai/botmaster-test","last_synced_at":"2025-09-04T10:33:31.263Z","repository":{"id":57190222,"uuid":"79439784","full_name":"botmasterai/botmaster-test","owner":"botmasterai","description":"helper utilities for testing botmaster","archived":false,"fork":false,"pushed_at":"2017-05-15T13:35:09.000Z","size":42,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T02:47:32.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botmasterai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T09:58:57.000Z","updated_at":"2017-07-15T22:14:03.000Z","dependencies_parsed_at":"2022-08-27T12:11:11.185Z","dependency_job_id":null,"html_url":"https://github.com/botmasterai/botmaster-test","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botmasterai%2Fbotmaster-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botmasterai","download_url":"https://codeload.github.com/botmasterai/botmaster-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240605843,"owners_count":19827985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:04:06.840Z","updated_at":"2025-02-25T05:14:42.166Z","avatar_url":"https://github.com/botmasterai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utilities for testing botmaster\n\n## Quick start example\n\nFor an example please see the tests in this repo:\n\u003chttps://github.com/botmasterai/botmaster-fulfill/blob/master/src/tests/fulfill-e2e.js\u003e\n\n## Usage\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### respond\n\nhave bot master response done with a text. Chain it by calling it response(botmaster)(text)\n\n**Parameters**\n\n-   `botmaster` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** botmaster to work with\n-   `text` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** bot text to send\n\n### incomingMessage\n\ngenerate a new telegram incoming message for use with botmaster\n\n**Parameters**\n\n-   `text` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?= 'hi'** optional - the users text\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** a mock telegram incoming message to use with telegramMock.sendMessage\n\n### incomingUpdate\n\ngenerate an incoming update\n\n**Parameters**\n\n-   `text` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** the bots text\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** mock botmaster update after update handler\n\n### outgoingMessage\n\ngenerate an outgoing message\n\n**Parameters**\n\n-   `text` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** the bots text\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** message to send with bot.sendMessage\n\n### telegramMock\n\nA chainable mock for telegram that can send and expect messages. Construct it by calling it with these params.\n\n**Parameters**\n\n-   `botmaster` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the botmaster object being tested. we use this to get the app for use with supertest.\n-   `mock` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** a nock scope\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** mock object with methods\n\n### sendUpdate\n\nmock telegram sending botmaster an update\n\n**Parameters**\n\n-   `update` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** telegram update\n-   `cb` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** error-first callback with response object from botmaster\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the telegraMock object for chaining\n\n### expect\n\nexpect botmaster to send certain responses\n\n**Parameters**\n\n-   `responses` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** a series of botmaster responses to expect in order\n-   `cb` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** error-first callback\n\nReturns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the telegraMock object for chaining\n\n### cleanAll\n\nsugar syntax for nock.cleanAll() to remove any existing mocks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotmasterai%2Fbotmaster-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotmasterai%2Fbotmaster-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotmasterai%2Fbotmaster-test/lists"}