Skip to content

Commit

Permalink
base_url test and full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmad11 committed Jun 23, 2020
1 parent 447640e commit 1e135df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
token: ${{secrets.token}}
token_secret: ${{secrets.token_secret}}
realm: ${{secrets.realm}}
base_url: ${{secrets.base_url}}
COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}"
COVERALLS_GIT_BRANCH: "${{ github.ref }}"

Expand Down
8 changes: 5 additions & 3 deletions netsuite-rest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var NsApiWrapper = require('./netsuite-rest.js');
describe('Netsuite Rest Webservices', () => {
jest.setTimeout(10000);
let NsApi;
let NsApiBaseUrl;

beforeAll(async () => {
NsApi = new NsApiWrapper({
Expand All @@ -15,7 +16,7 @@ describe('Netsuite Rest Webservices', () => {
});

// with base_url
netsuite = new NsApiWrapper({
NsApiBaseUrl = new NsApiWrapper({
consumer_key: process.env.consumer_key,
consumer_secret_key: process.env.consumer_secret_key,
token: process.env.token,
Expand Down Expand Up @@ -76,8 +77,9 @@ describe('Netsuite Rest Webservices', () => {


test('should work with base_url', () => {
expect.assertions(1);
return netsuite.request({
expect.assertions(2);
expect(process.env.base_url).toBeDefined();
return NsApiBaseUrl.request({
method: "OPTIONS"
})
.then(response => expect(response.statusCode).toEqual(204))
Expand Down

0 comments on commit 1e135df

Please sign in to comment.