-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Node Cloud Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [12.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: yarn install and test | ||
run: | | ||
yarn install | ||
yarn test | ||
env: | ||
CI: true |
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,23 +1,36 @@ | ||
const nodeCloud = require("../../lib/"); | ||
const ncAWS = nodeCloud.getProvider("AWS", process.env.ncconf); | ||
const optionsProvider = { | ||
overrideProviders: false | ||
}; | ||
const ncProviders = nodeCloud.getProviders(optionsProvider); | ||
const assert = require("chai").assert; | ||
|
||
const options = { | ||
apiVersion: "2016-11-15" | ||
}; | ||
|
||
// get nosql object for AWS | ||
const dynamoDB = ncAWS.nosql(options); | ||
// Initialize dynamoDB object to access AWS DynamoDB | ||
const dynamoDB = ncProviders.aws.nosql(options); | ||
|
||
const params = { | ||
Item: { | ||
artist: { | ||
S: "GG" | ||
id: { | ||
S: "1" | ||
}, | ||
racer: { | ||
S: "Carroll Shelby" | ||
} | ||
}, | ||
ReturnConsumedCapacity: "TOTAL", | ||
TableName: "Test" | ||
}; | ||
|
||
dynamoDB.createItem(params).then((res) => { | ||
assert.equal(res.ConsumedCapacity.TableName, "Test"); | ||
done(); | ||
}); | ||
dynamoDB | ||
.createItem(params) | ||
.then((res) => { | ||
assert.equal(res.ConsumedCapacity.TableName, "Test"); | ||
console.log("Response :", res); | ||
}) | ||
.catch((err) => { | ||
console.log("Error:", 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