Skip to content

Commit 3c77013

Browse files
authored
Refactor Cloud Functions samples. (GoogleCloudPlatform#245)
1 parent eeeaa98 commit 3c77013

File tree

94 files changed

+3083
-2545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3083
-2545
lines changed

appengine/analytics/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"express": "^4.14.0",
17-
"request": "^2.75.0"
18-
},
19-
"devDependencies": {
20-
"mocha": "^3.1.0"
16+
"express": "4.14.0",
17+
"request": "2.78.0"
2118
}
2219
}

appengine/bower/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@
1010
},
1111
"scripts": {
1212
"postinstall": "bower install --config.interactive=false",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"bower": "^1.7.9",
17-
"express": "^4.14.0",
18-
"pug": "^2.0.0-beta6"
19-
},
20-
"devDependencies": {
21-
"mocha": "^3.1.0"
16+
"bower": "1.8.0",
17+
"express": "4.14.0",
18+
"pug": "2.0.0-beta6"
2219
}
2320
}

appengine/cloudsql/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
"node": ">=4.3.2"
1010
},
1111
"scripts": {
12-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
12+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1313
},
1414
"dependencies": {
15-
"express": "^4.14.0",
16-
"mysql": "^2.11.1",
17-
"prompt": "^1.0.0"
18-
},
19-
"devDependencies": {
20-
"mocha": "^3.1.0"
15+
"express": "4.14.0",
16+
"mysql": "2.12.0",
17+
"prompt": "1.0.0"
2118
}
2219
}

appengine/datastore/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function getVisits (callback) {
7171
callback(err);
7272
return;
7373
}
74-
callback(null, entities.map((entity) => `Time: ${entity.data.timestamp}, AddrHash: ${entity.data.userIp}`));
74+
callback(null, entities.map((entity) => `Time: ${entity.timestamp}, AddrHash: ${entity.userIp}`));
7575
});
7676
}
7777
// [END getVisits]

appengine/datastore/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"@google-cloud/datastore": "^0.4.0",
17-
"express": "^4.14.0"
18-
},
19-
"devDependencies": {
20-
"mocha": "^3.1.0"
16+
"@google-cloud/datastore": "0.5.0",
17+
"express": "4.14.0"
2118
}
2219
}

appengine/datastore/test/app.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ function getSample () {
3939
const expressMock = sinon.stub().returns(testApp);
4040
const resultsMock = [
4141
{
42-
data: {
43-
timestamp: `1234`,
44-
userIp: `abcd`
45-
}
42+
timestamp: `1234`,
43+
userIp: `abcd`
4644
}
4745
];
4846
const queryMock = {

appengine/disk/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"express": "^4.14.0"
17-
},
18-
"devDependencies": {
19-
"mocha": "^3.1.0"
16+
"express": "4.14.0"
2017
}
2118
}

appengine/endpoints/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
"license": "Apache Version 2.0",
77
"author": "Google Inc.",
88
"engines": {
9-
"node": "~4.2"
9+
"node": ">=4.3.2"
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"express": "^4.13.4",
17-
"body-parser": "^1.15.0"
18-
},
19-
"devDependencies": {
20-
"mocha": "^2.5.3"
16+
"express": "4.14.0",
17+
"body-parser": "1.15.2"
2118
}
2219
}

appengine/errorreporting/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "mocha -R spec -t 120000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"express": "^4.14.0",
17-
"winston": "^2.2.0"
18-
},
19-
"devDependencies": {
20-
"mocha": "^3.1.0"
16+
"express": "4.14.0",
17+
"winston": "2.3.0"
2118
}
2219
}

appengine/express-memcached-session/package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
},
1111
"scripts": {
1212
"start": "node server.js",
13-
"test": "mocha -R spec -t 1000 --require intelli-espower-loader ../../test/_setup.js test/*.test.js"
13+
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
16-
"connect-memjs": "^0.1.0",
17-
"cookie-parser": "^1.4.3",
18-
"express": "^4.14.0",
19-
"express-session": "^1.14.2",
20-
"public-ip": "^2.0.1"
21-
},
22-
"devDependencies": {
23-
"mocha": "^3.1.2"
16+
"connect-memjs": "0.1.0",
17+
"cookie-parser": "1.4.3",
18+
"express": "4.14.0",
19+
"express-session": "1.14.2",
20+
"public-ip": "2.0.1"
2421
}
2522
}

0 commit comments

Comments
 (0)