Skip to content

Commit 2117408

Browse files
authored
chore: refactor all instances of repo-tools (GoogleCloudPlatform#1749)
1 parent fed38fa commit 2117408

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

appengine/endpoints/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616
"deploy": "gcloud app deploy",
1717
"start": "node app.js",
1818
"unit-test": "mocha test/ --timeout=60000 --exit",
19-
"system-test": "repo-tools test app",
20-
"all-test": "npm run unit-test && npm run system-test",
21-
"test": "repo-tools test run --cmd npm -- run all-test"
19+
"test": "npm run unit-test"
2220
},
2321
"dependencies": {
2422
"body-parser": "^1.18.3",
25-
"express": "^4.16.4"
23+
"chai": "^4.2.0",
24+
"express": "^4.16.4",
25+
"wait-port": "^0.2.7"
2626
},
2727
"devDependencies": {
28-
"@google-cloud/nodejs-repo-tools": "^3.3.0",
2928
"mocha": "^7.0.0",
3029
"proxyquire": "^2.1.0",
3130
"sinon": "^9.0.0",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const waitPort = require('wait-port');
2+
const {expect} = require('chai');
3+
const PORT = process.env.PORT || 8080;
4+
const childProcess = require('child_process');
5+
const path = require('path');
6+
const appPath = path.join(__dirname, '../app.js');
7+
8+
describe('server listening', () => {
9+
it('should be listening', async () => {
10+
const child = childProcess.exec(`node ${appPath}`);
11+
const isOpen = await waitPort({port: PORT});
12+
expect(isOpen).to.be.true;
13+
process.kill(child.pid, 'SIGTERM');
14+
});
15+
});

0 commit comments

Comments
 (0)