Skip to content

Commit

Permalink
Merge pull request #72 from StackStorm/clean-up
Browse files Browse the repository at this point in the history
Clean up a few things
  • Loading branch information
blag authored Jul 26, 2019
2 parents 8cf5c8a + 73f0f54 commit d278ee5
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ node_modules

# Custom
dist
package-lock.json
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "st2client",
"version": "1.2.0",
"version": "1.2.1",
"description": "StackStorm ST2 API library",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -31,9 +31,14 @@
"engine": {
"node": ">=0.11.0"
},
"files": [
"/index.js",
"/lib"
],
"dependencies": {
"axios": "^0.7.0",
"eventsource": "^0.1.4",
"lodash": "^4.17.15",
"object.assign": "^1.0.1"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions tests/test-attributable.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ describe('Attributable', function () {

var result = api.attribute(1, 'some', {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -59,7 +60,8 @@ describe('Attributable', function () {

var result = api.attribute(1, 'some', {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-deletable.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ describe('Deletable', function () {

var result = api.delete(1, {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -59,7 +60,8 @@ describe('Deletable', function () {

var result = api.delete(1, {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ describe('Editable', function () {

var result = api.edit(ref, request, query, {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -154,7 +155,8 @@ describe('Editable', function () {

var result = api.edit(ref, request, query, {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
5 changes: 2 additions & 3 deletions tests/test-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
'use strict';

var expect = require('chai').expect
, EventEmitter = require('events')
, nock = require('nock')
;

Expand Down Expand Up @@ -90,7 +89,7 @@ describe('Endpoint', function () {

var test_endpoint = Object.create({}, {test: test_endpoint_descriptor});

var scope = nock('http://localhost:8080')
nock('http://localhost:8080')
.get('/test')
.matchHeader('x-auth-token', 'token-aaaa')
.reply(200, {});
Expand Down Expand Up @@ -135,7 +134,7 @@ describe('Endpoint', function () {

var test_endpoint = Object.create({}, {test: test_endpoint_descriptor});

var scope = nock('http://localhost:8080')
nock('http://localhost:8080')
.get('/test')
.matchHeader('st2-api-key', 'key-cccc')
.reply(200, {});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-enumerable.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ describe('Enumerable', function () {

var result = api.listAll({ a: 'b' }, {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -78,7 +79,8 @@ describe('Enumerable', function () {

var result = api.listAll({ a: 'b' }, {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-paginatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ describe('Paginatable', function () {

var result = api.listPage(5, { a: 'b', limit: 100 }, {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -166,7 +167,8 @@ describe('Paginatable', function () {

var result = api.listPage(5, { a: 'b', limit: 100 }, {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ describe('Readable', function () {

var result = api.get(1, {a: 'b'}, {token: 'token-aaaa'});

result.then(function (response) {
result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -59,7 +60,8 @@ describe('Readable', function () {

var result = api.get(1, {a: 'b'}, {key: 'key-cccc'});

result.then(function (response) {
result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-repeatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ describe('Repeatable', function () {

var result = api.repeat(id, request, 'test', {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -72,7 +73,8 @@ describe('Repeatable', function () {

var result = api.repeat(id, request, 'test', {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-schedulable.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ describe('Schedulable', function () {

var result = api.schedule({}, 'test', {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -69,7 +70,8 @@ describe('Schedulable', function () {

var result = api.schedule({}, 'test', {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down
6 changes: 4 additions & 2 deletions tests/test-writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ describe('Writable', function () {

var result = api.create(request, {token: 'token-aaaa'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand All @@ -69,7 +70,8 @@ describe('Writable', function () {

var result = api.create(request, {key: 'key-cccc'});

return result.then(function (response) {
return result.then(function () {
/* jshint expr: true */
expect(mock.isDone()).to.be.true;
});
});
Expand Down

0 comments on commit d278ee5

Please sign in to comment.