forked from hopetambala/puente-node-cloudcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hopetambala#526 from hopetambala/PLATFORM-602
Platform 602 - Add slackbot module
- Loading branch information
Showing
18 changed files
with
997 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,53 @@ | ||
name: Jest Tests | ||
|
||
env: | ||
PARSE_ENV : "dev" | ||
PARSE_APP_ID : "myAppId" | ||
PARSE_JAVASCRIPT_KEY : "_PLACEHOLDER_" | ||
PARSE_SERVER_URL : "http://localhost:1337/parse" | ||
PARSE_ENV: "dev" | ||
PARSE_APP_ID: "myAppId" | ||
PARSE_JAVASCRIPT_KEY: "_PLACEHOLDER_" | ||
PARSE_SERVER_URL: "http://localhost:1337/parse" | ||
PUENTE_ENV: "dev" | ||
PUENTE_SMS_EMAIL_API_URL: "http://puentes-messaging-microservice.com" | ||
PUENTE_MANAGE_URL: "https://sample-puente-manage.app/" | ||
SLACK_TOKEN: "" | ||
SLACK_DEV_CHANNEL: "" | ||
SLACK_PROD_CHANNEL: "" | ||
|
||
on: | ||
push: | ||
branches: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
branches: | ||
- master | ||
- dev | ||
jobs: | ||
jest-testing: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x,14.x] | ||
node-version: [14.x, 16.x] | ||
services: | ||
mongodb: | ||
image: mongo:4.4 | ||
ports: | ||
- 27017:27017 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Puente CloudCode Dependencies | ||
run: | | ||
npm install | ||
- name: Lint | ||
run: | | ||
npm run lint | ||
- name: Start App and Test Jest | ||
run: | | ||
npm run start & | ||
sleep 40 && | ||
npm run test-github-actions | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Puente CloudCode Dependencies | ||
run: | | ||
npm install | ||
- name: Lint | ||
run: | | ||
npm run lint | ||
- name: Start App and Test Jest | ||
run: | | ||
npm run start & | ||
sleep 40 && | ||
npm run test-github-actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ logs | |
*.DS_Store | ||
/coverage | ||
.parse.local | ||
.env.staging | ||
.env.prod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { MongoClient } = require('mongodb'); | ||
const { cloudFunctions } = require('../run-cloud'); | ||
|
||
describe('crud testing', () => { | ||
let connection; | ||
let db; | ||
|
||
beforeAll(async () => { | ||
connection = await MongoClient.connect(process.env.MONGO_URL, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}); | ||
db = await connection.db(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await connection.close(); | ||
await db.close(); | ||
}); | ||
|
||
it('Test error response in SurveyData post when empy params', async () => { | ||
const postParams = { | ||
}; | ||
return cloudFunctions.postObjectsToClass(postParams).then((result) => { | ||
const err = 'Error: no request params'; | ||
expect(result).toEqual(err); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"dependencies": { | ||
"@slack/web-api": "^6.8.0", | ||
"axios": "^0.27.2", | ||
"lodash": "^4.17.19" | ||
} | ||
} |
Oops, something went wrong.