Skip to content

Commit

Permalink
clean up package files, add super basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrown committed Apr 22, 2019
1 parent 95585ad commit 6b0d9a5
Show file tree
Hide file tree
Showing 21 changed files with 359 additions and 96 deletions.
34 changes: 28 additions & 6 deletions packages/botbuilder-adapter-facebook/package.json
@@ -1,18 +1,40 @@
{
"name": "botbuilder-adapter-facebook",
"version": "1.0.0",
"description": "",
"description": "Connect Botkit or BotBuilder to Facebook Messenger",
"main": "lib/index.js",
"typings": "./lib/index.d.ts",
"files": [
"/lib",
"/src"
],
"scripts": {
"build": "tsc",
"test": "tsc ; nyc mocha tests/*.tests.js",
"eslint": "./node_modules/.bin/eslint --fix src/*",
"start": "node ./index.js"
"eslint": "./node_modules/.bin/eslint --fix src/*"
},
"author": "Microsoft Corp.",
"license": "MIT",
"keywords": [
"facebook",
"facebook messenger",
"botkit",
"botbuilder",
"botframework",
"bots",
"chatbots",
"azure"
],
"homepage": "https://github.com/howdyai/botkit/blob/packages/botbuilder-adapter-facebook#readme",
"bugs": {
"url": "https://github.com/howdyai/botkit/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/howdyai/botkit.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"botbuilder": "^4.2.0",
"botbuilder": "^4.3.0",
"botkit": "^4.0.0",
"debug": "^4.1.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/botbuilder-adapter-hangouts/.gitignore
@@ -1,3 +1,4 @@
node_modules/
.env
lib/
lib/
.nyc_output/
40 changes: 30 additions & 10 deletions packages/botbuilder-adapter-hangouts/package.json
@@ -1,20 +1,40 @@
{
"name": "botbuilder-adapter-hangouts",
"version": "1.0.0",
"description": "",
"main": "lib/index.js",
"description": "Connect Botkit or BotBuilder to Google Hangouts",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"files": [
"/lib",
"/src"
],
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1",
"eslint": "./node_modules/.bin/eslint --fix src/*",
"start": "node ./index.js"
"test": "tsc ; nyc mocha tests/*.tests.js",
"eslint": "./node_modules/.bin/eslint --fix src/*"
},
"author": "Microsoft Corp.",
"license": "MIT",
"keywords": [
"google hangouts",
"hangouts",
"botkit",
"botbuilder",
"botframework",
"bots",
"chatbots",
"azure"
],
"homepage": "https://github.com/howdyai/botkit/blob/packages/botbuilder-adapter-hangouts#readme",
"bugs": {
"url": "https://github.com/howdyai/botkit/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/howdyai/botkit.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"botbuilder": "^4.2.0",
"botbuilder-dialogs": "^4.2.0",
"botframework-config": "^4.2.0",
"botbuilder": "^4.3.0",
"googleapis": "^34.0.0",
"botkit": "^4.0.0",
"debug": "^4.1.0"
Expand Down
@@ -0,0 +1,22 @@
const assert = require('assert');
const { HangoutsAdapter } = require('../');

describe('HangoutsAdapter', function() {

let adapter;

// beforeEach(function () {
// adapter = new HangoutsAdapter({
// token: '123',
// });
// });

it('should not construct without required parameters', function () {
assert.throws(function () { let adapter = new HangoutsAdapter({}) }, 'Foo');
});

// it('should create a HangoutsAdapter object', function () {
// assert((adapter instanceof HangoutsAdapter), 'Adapter is wrong type');
// });

});
3 changes: 2 additions & 1 deletion packages/botbuilder-adapter-slack/.gitignore
@@ -1,3 +1,4 @@
node_modules/
.env
lib/
lib/
.nyc_output/
8 changes: 2 additions & 6 deletions packages/botbuilder-adapter-slack/package.json
Expand Up @@ -10,7 +10,7 @@
],
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1",
"test": "tsc ; nyc mocha tests/*.tests.js",
"eslint": "./node_modules/.bin/eslint --fix src/*"
},
"author": "Microsoft Corp.",
Expand All @@ -35,12 +35,8 @@
"dependencies": {
"@slack/client": "^4.7.0",
"botbuilder": "^4.3.0",
"botbuilder-dialogs": "^4.3.0",
"botframework-config": "^4.3.0",
"botkit": "^4.0.0",
"debug": "^4.1.0",
"dotenv": "^6.0.0",
"restify": "^7.2.1"
"debug": "^4.1.0"
},
"devDependencies": {
"eslint": "^5.5.0",
Expand Down
28 changes: 28 additions & 0 deletions packages/botbuilder-adapter-slack/tests/SlackAdapter.tests.js
@@ -0,0 +1,28 @@
const assert = require('assert');
const { SlackAdapter } = require('../');

describe('SlackAdapter', function() {

let adapter;

beforeEach(function () {
adapter = new SlackAdapter({
clientSigningSecret: '123',
clientId: '123',
clientSecret: '123',
scopes: ['bot'],
redirectUri: 'https://fake.com/install/auth',
getBotUserByTeam: async(team) => '123',
getTokenForTeam: async(team) => '123',
});
});

it('should not construct without required parameters', function () {
assert.throws(function () { let adapter = new SlackAdapter({}) }, 'Foo');
});

it('should create a SlackAdapter object', function () {
assert((adapter instanceof SlackAdapter), 'Adapter is wrong type');
});

});
3 changes: 2 additions & 1 deletion packages/botbuilder-adapter-twilio-sms/.gitignore
@@ -1,3 +1,4 @@
node_modules/
.env
lib/
lib/
.nyc_output/
43 changes: 33 additions & 10 deletions packages/botbuilder-adapter-twilio-sms/package.json
@@ -1,20 +1,43 @@
{
"name": "botbuilder-adapter-twilio-sms",
"version": "1.0.0",
"description": "",
"main": "lib/index.js",
"description": "Connect Botkit or BotBuilder to Twilio SMS",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"files": [
"/lib",
"/src"
],
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1",
"eslint": "./node_modules/.bin/eslint --fix src/*",
"start": "node ./index.js"
"test": "tsc ; nyc mocha tests/*.tests.js",
"eslint": "./node_modules/.bin/eslint --fix src/*"
},
"author": "Microsoft Corp.",
"license": "MIT",
"keywords": [
"twilio",
"sms",
"twilio sms",
"texting",
"txting",
"botkit",
"botbuilder",
"botframework",
"bots",
"chatbots",
"azure"
],
"homepage": "https://github.com/howdyai/botkit/blob/packages/botbuilder-adapter-twilio-sms#readme",
"bugs": {
"url": "https://github.com/howdyai/botkit/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/howdyai/botkit.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"botbuilder": "^4.2.0",
"botbuilder-dialogs": "^4.2.0",
"botframework-config": "^4.2.0",
"botbuilder": "^4.3.0",
"botkit": "^4.0.0",
"debug": "^4.1.0",
"twilio": "^3.29.2"
Expand Down
@@ -0,0 +1,24 @@
const assert = require('assert');
const { TwilioAdapter } = require('../');

describe('TwilioAdapter', function() {

let adapter;

beforeEach(function () {
adapter = new TwilioAdapter({
twilio_number: '14155551212',
account_sid: 'AC123123',
auth_token: '123123',
});
});

it('should not construct without required parameters', function () {
assert.throws(function () { let adapter = new TwilioAdapter({}) }, 'Foo');
});

it('should create a TwilioAdapter object', function () {
assert((adapter instanceof TwilioAdapter), 'Adapter is wrong type');
});

});
3 changes: 2 additions & 1 deletion packages/botbuilder-adapter-web/.gitignore
@@ -1,3 +1,4 @@
node_modules/
.env
lib/
lib/
.nyc_output/
40 changes: 31 additions & 9 deletions packages/botbuilder-adapter-web/package.json
@@ -1,21 +1,43 @@
{
"name": "botbuilder-adapter-web",
"version": "1.0.0",
"description": "",
"main": "lib/web_adapter.js",
"description": "Connect Botkit or BotBuilder to the Web",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"files": [
"/lib",
"/src",
"/client"
],
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1",
"eslint": "./node_modules/.bin/eslint --fix src/*",
"start": "node ./index.js"
"test": "tsc ; nyc mocha tests/*.tests.js",
"eslint": "./node_modules/.bin/eslint --fix src/*"
},
"author": "benbrown@gmail.com",
"author": "Microsoft Corp.",
"license": "MIT",
"keywords": [
"webchat",
"websocket",
"botkit",
"botbuilder",
"botframework",
"bots",
"chatbots",
"azure"
],
"homepage": "https://github.com/howdyai/botkit/blob/packages/botbuilder-adapter-web#readme",
"bugs": {
"url": "https://github.com/howdyai/botkit/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/howdyai/botkit.git"
},
"dependencies": {
"botkit": "^4.0.0",
"botbuilder": "^4.2.0",
"botbuilder": "^4.3.0",
"debug": "^4.1.0",
"dotenv": "^6.0.0",
"url": "^0.11.0",
"ws": "^6.1.3"
},
Expand All @@ -27,4 +49,4 @@
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0"
}
}
}
21 changes: 21 additions & 0 deletions packages/botbuilder-adapter-web/tests/WebAdapter.tests.js
@@ -0,0 +1,21 @@
const assert = require('assert');
const { WebAdapter } = require('../');

describe('WebAdapter', function() {

let adapter;

beforeEach(function () {
adapter = new WebAdapter({
});
});

it('should contruct without any parameters (none are required)', function () {
assert.doesNotThrow(function () { let adapter = new WebAdapter({}); }, 'Foo');
});

it('should create a WebAdapter object', function () {
assert((adapter instanceof WebAdapter), 'Adapter is wrong type');
});

});
1 change: 1 addition & 0 deletions packages/botbuilder-adapter-webex/.gitignore
@@ -1,3 +1,4 @@
.nyc_output/
node_modules/
.env
lib/

0 comments on commit 6b0d9a5

Please sign in to comment.