-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor tests. * Tweak build. * Tweak build. * More tests. * Tweak build. * Tweak build. * Fix build. * Fix build. * Speed up build. * Fix build. * Remove extra dep. * Investigate why 0.12 fails. * Scripts. * More tests. * Upgrades * Upgrades * Update readme
- Loading branch information
Showing
9 changed files
with
226 additions
and
6 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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
{ | ||
"name": "computeengine", | ||
"description": "Collection of Node.js samples on Google Compute Engine.", | ||
"name": "nodejs-docs-samples-computeengine", | ||
"version": "0.0.1", | ||
"private": true, | ||
"license": "Apache Version 2.0", | ||
"author": "Google Inc.", | ||
"engines": { | ||
"node": ">=0.10.x" | ||
"scripts": { | ||
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../test/_setup.js test/*.test.js", | ||
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js" | ||
}, | ||
"dependencies": { | ||
"gcloud": "^0.34.0", | ||
"googleapis": "^7.1.0", | ||
"gcloud": "^0.37.0", | ||
"googleapis": "^12.0.0", | ||
"nodemailer": "^2.4.1", | ||
"nodemailer-smtp-transport": "^2.5.0", | ||
"sendgrid": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.5.3" | ||
} | ||
} |
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,18 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
describe('computeengine:mailjet', function () { | ||
it('should be tested'); | ||
}); |
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,18 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
describe('computeengine:sendgrid', function () { | ||
it('should be tested'); | ||
}); |
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,27 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
var vmsExample = require('../vms'); | ||
|
||
describe('computeengine:vms', function () { | ||
it('should retrieve vms', function (done) { | ||
vmsExample.main(function (err, result) { | ||
assert(!err); | ||
assert(result); | ||
assert(Array.isArray(result)); | ||
done(); | ||
}); | ||
}); | ||
}); |
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,26 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
var vmsExample = require('../vms_api'); | ||
|
||
describe('computeengine:vms_api', function () { | ||
it('should retrieve vms', function (done) { | ||
vmsExample.main(function (err, result) { | ||
assert(!err); | ||
assert(result); | ||
done(); | ||
}); | ||
}); | ||
}); |
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,53 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
var proxyquire = require('proxyquire').noPreserveCache(); | ||
process.env.MAILJET_API_KEY = 'foo'; | ||
process.env.MAILJET_API_SECRET = 'bar'; | ||
|
||
describe('computeengine:mailjet', function () { | ||
it('should send an email', function (done) { | ||
proxyquire('../mailjet', { | ||
nodemailer: { | ||
createTransport: function (arg) { | ||
assert.equal(arg, 'test'); | ||
return { | ||
sendMail: function (payload, cb) { | ||
assert.deepEqual(payload, { | ||
from: 'ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM', | ||
to: '[email protected]', | ||
subject: 'test email from Node.js on Google Cloud Platform', | ||
text: 'Hello!\n\nThis a test email from Node.js.' | ||
}); | ||
cb('done'); | ||
done(); | ||
} | ||
}; | ||
} | ||
}, | ||
'nodemailer-smtp-transport': function (options) { | ||
assert.deepEqual(options, { | ||
host: 'in.mailjet.com', | ||
port: 2525, | ||
auth: { | ||
user: 'foo', | ||
pass: 'bar' | ||
} | ||
}); | ||
return 'test'; | ||
} | ||
}); | ||
}); | ||
}); |
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,39 @@ | ||
// Copyright 2015-2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
var proxyquire = require('proxyquire').noPreserveCache(); | ||
process.env.SENDGRID_API_KEY = 'foo'; | ||
|
||
describe('computeengine:sendgrid', function () { | ||
it('should send an email', function (done) { | ||
proxyquire('../sendgrid', { | ||
sendgrid: function (key) { | ||
assert.equal(key, 'foo'); | ||
return { | ||
send: function (payload, cb) { | ||
assert.deepEqual(payload, { | ||
from: 'ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM', | ||
to: '[email protected]', | ||
subject: 'test email from Node.js on Google Cloud Platform', | ||
text: 'Hello!\n\nThis a test email from Node.js.' | ||
}); | ||
cb('done'); | ||
done(); | ||
} | ||
}; | ||
} | ||
}); | ||
}); | ||
}); |
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,18 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
describe('computeengine:vms', function () { | ||
it('should be tested'); | ||
}); |
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,18 @@ | ||
// Copyright 2016, Google, Inc. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
'use strict'; | ||
|
||
describe('computeengine:vms_api', function () { | ||
it('should be tested'); | ||
}); |