Skip to content

Commit

Permalink
script compiler moved to botium
Browse files Browse the repository at this point in the history
  • Loading branch information
codeforequity-at committed Feb 1, 2018
1 parent f1e0afe commit e9f7a38
Show file tree
Hide file tree
Showing 26 changed files with 3,113 additions and 4,432 deletions.
Empty file modified bin/testmybot.js 100644 → 100755
Empty file.
263 changes: 233 additions & 30 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "testmybot",
"version": "1.1.2",
"version": "1.2.0",
"engines": {
"node": ">=6.0"
},
Expand Down Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"async": "^2.1.5",
"body-parser": "^1.18.2",
"botium-core": "1.1.4",
"botium-core": "1.1.7",
"chai": "^4.1.2",
"chalk": "^2.3.0",
"clear": "0.0.1",
Expand All @@ -49,6 +49,7 @@
"n-readlines": "^0.2.7",
"opn": "^5.1.0",
"readline": "^1.3.0",
"slug": "^0.9.1",
"yargs": "^10.1.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Expand Up @@ -6,12 +6,12 @@ export default {
input: 'index.js',
output: [
{
file: 'dist/botium-es.js',
file: 'dist/testmybot-es.js',
format: 'es',
sourcemap: true
},
{
file: 'dist/botium-cjs.js',
file: 'dist/testmybot-cjs.js',
format: 'cjs',
sourcemap: true
}
Expand Down
24 changes: 13 additions & 11 deletions samples/facebook/spec/testmybot.spec.js
@@ -1,29 +1,31 @@
const bot = require('testmybot');
const jasmineHelper = bot.helper.jasmine();
const TestMyBot = require('testmybot')
const jasmineHelper = TestMyBot.helper.jasmine();

const tmb = new TestMyBot()

describe('TestMyBot Sample Conversation Test Suite', function() {

beforeAll(function(done) {
bot.beforeAll().then(done);
tmb.beforeAll().then(done);
}, 120000); //lots of timeout, first docker build could take pretty long

beforeEach(function(done) {
bot.beforeEach().then(done);
tmb.beforeEach().then(done);
}, 60000);

afterEach(function(done) {
bot.afterEach().then(done);
tmb.afterEach().then(done);
}, 60000);

afterAll(function(done) {
bot.afterAll().then(done);
tmb.afterAll().then(done);
}, 60000);

it('should answer to hello', function(done) {

bot.hears('hello');
tmb.hears('hello');

bot.says().then((msg) => {
tmb.says().then((msg) => {
console.log('got Message: ' + JSON.stringify(msg));
expect(msg && msg.messageText).toMatch(/echo/);
done();
Expand All @@ -34,9 +36,9 @@ describe('TestMyBot Sample Conversation Test Suite', function() {

it('should send a generic payload', function(done) {

bot.hears('Generic');
tmb.hears('Generic');

bot.says().then((msg) => {
tmb.says().then((msg) => {
console.log('got Message: ' + JSON.stringify(msg));
expect(msg && msg.sourceData && msg.sourceData.message && msg.sourceData.message.attachment && msg.sourceData.message.attachment.type).toEqual('template');
expect(msg && msg.sourceData && msg.sourceData.message && msg.sourceData.message.attachment && msg.sourceData.message.attachment.payload.template_type).toEqual('generic');
Expand All @@ -46,5 +48,5 @@ describe('TestMyBot Sample Conversation Test Suite', function() {
});
}, 10000);

jasmineHelper.setupJasmineTestCases(60000);
jasmineHelper.setupJasmineTestCases(60000, null, tmb);
});

0 comments on commit e9f7a38

Please sign in to comment.