Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Commit

Permalink
1.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Feb 21, 2018
1 parent 04ec0b0 commit 54ce914
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 58 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 1.0.0-beta.2 - 20 February 2017

###### Other
- Updated dependencies

##### 1.0.0-beta.1 - 20 February 2017

###### Breaking changes
Expand Down
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@google-cloud/functions-emulator",
"description": "Google Cloud Functions Emulator",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
Expand Down Expand Up @@ -52,6 +52,7 @@
],
"scripts": {
"lint": "semistandard",
"fix": "semistandard --fix",
"mocha": "mocha test/_setup test/ --recursive -t 120000 -S -R spec --require intelli-espower-loader",
"unit-test": "npm run mocha -- --grep \"unit/\"",
"system-test": "npm run mocha -- --grep \"system/\"",
Expand All @@ -66,38 +67,38 @@
"generate-scaffolding": "repo-tools generate contributors coc contributing license pr_template pkgjson"
},
"dependencies": {
"@google-cloud/storage": "1.5.1",
"@google-cloud/storage": "1.6.0",
"adm-zip": "0.4.7",
"ajv": "5.5.2",
"ajv": "6.1.1",
"body-parser": "1.18.2",
"cli-table2": "0.2.0",
"colors": "1.1.2",
"configstore": "3.1.1",
"express": "4.16.2",
"googleapis": "23.0.0",
"got": "8.0.1",
"got": "8.2.0",
"http-proxy": "1.16.2",
"lodash": "4.17.4",
"lodash": "4.17.5",
"prompt": "1.0.0",
"rimraf": "2.6.2",
"semver": "5.4.1",
"semver": "5.5.0",
"serializerr": "1.0.3",
"tmp": "0.0.33",
"uuid": "3.1.0",
"uuid": "3.2.1",
"winston": "2.4.0",
"yargs": "10.0.3"
"yargs": "11.0.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "2.1.3",
"@google-cloud/nodejs-repo-tools": "2.2.0",
"intelli-espower-loader": "1.0.1",
"mocha": "4.0.1",
"nock": "9.1.4",
"nyc": "11.3.0",
"mocha": "5.0.1",
"nock": "9.1.6",
"nyc": "11.4.1",
"power-assert": "1.4.4",
"proxyquire": "1.8.0",
"semistandard": "11.0.0",
"semistandard": "12.0.0",
"semistandard-format": "3.0.0",
"sinon": "4.1.3",
"sinon": "4.3.0",
"supertest": "3.0.0"
}
}
10 changes: 5 additions & 5 deletions src/cli/commands/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ exports.handler = (opts) => {
controller.write('Deleting function');
poll();
})
.then(() => controller.write('done.\n'))
.catch((err) => {
controller.write('failed.\n');
return Promise.reject(err);
});
.then(() => controller.write('done.\n'))
.catch((err) => {
controller.write('failed.\n');
return Promise.reject(err);
});
})
.then(() => controller.log(`Function ${opts.functionName} deleted.`.green))
.then(() => list(opts))
Expand Down
10 changes: 5 additions & 5 deletions src/cli/commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ exports.handler = (opts) => {
controller.write('Deploying function');
poll();
})
.then(() => controller.write('done.\n'))
.catch((err) => {
controller.write('failed.\n');
return Promise.reject(err);
});
.then(() => controller.write('done.\n'))
.catch((err) => {
controller.write('failed.\n');
return Promise.reject(err);
});
})
// Log the status
.then(() => controller.log(`Function ${opts.functionName} deployed.`.green))
Expand Down
12 changes: 6 additions & 6 deletions src/model/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,13 @@ class Functions {
getOperation (name) {
logger.debug('Functions#getOperation', name);
return this.adapter.getOperation(name)
.then((operation) => {
if (!operation) {
return this._getOperationNotFoundError(name);
}
.then((operation) => {
if (!operation) {
return this._getOperationNotFoundError(name);
}

return this.operation(name, operation);
}, (err) => this._getOperationError(err));
return this.operation(name, operation);
}, (err) => this._getOperationError(err));
}

/**
Expand Down
56 changes: 28 additions & 28 deletions test/unit/service/rest-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ describe('unit/service/rest-service', () => {
const service = new RestService(functionsMock, {});

nock('https://faked.com')
.post('/fake-project/us-central1/test-function')
.reply(200);
.post('/fake-project/us-central1/test-function')
.reply(200);

request(service.server)
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
});

it(`should fill in correct default resource and eventType`, done => {
Expand All @@ -68,15 +68,15 @@ describe('unit/service/rest-service', () => {
const service = new RestService(functionsMock, {});

nock('https://faked.com')
.post('/fake-project/us-central1/test-function', {
resource: 'fake.resource',
eventType: 'fake.type'
})
.reply(200);
.post('/fake-project/us-central1/test-function', {
resource: 'fake.resource',
eventType: 'fake.type'
})
.reply(200);

request(service.server)
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
});

it(`should default auth to {admin:true} for Firebase database functions`, done => {
Expand All @@ -96,14 +96,14 @@ describe('unit/service/rest-service', () => {
const service = new RestService(functionsMock, {});

nock('https://faked.com')
.post('/fake-project/us-central1/test-function', {
auth: {admin: true}
})
.reply(200);
.post('/fake-project/us-central1/test-function', {
auth: {admin: true}
})
.reply(200);

request(service.server)
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.expect(200, done);
});

it(`should allow auth, eventType, and resource to be custom-defined`, done => {
Expand All @@ -123,19 +123,19 @@ describe('unit/service/rest-service', () => {
const service = new RestService(functionsMock, {});

nock('https://faked.com')
.post('/fake-project/us-central1/test-function', {
auth: {admin: false},
resource: 'custom.resource'
})
.reply(200);
.post('/fake-project/us-central1/test-function', {
auth: {admin: false},
resource: 'custom.resource'
})
.reply(200);

request(service.server)
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.send({
auth: {admin: false},
resource: 'custom.resource'
})
.expect(200, done);
.post('/v1/projects/fake-project/locations/us-central1/functions/test-function:call')
.send({
auth: {admin: false},
resource: 'custom.resource'
})
.expect(200, done);
});
});
});

0 comments on commit 54ce914

Please sign in to comment.