File tree 6 files changed +52
-3
lines changed
6 files changed +52
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Format: //devtools/kokoro/config/proto/build.proto
2
+
3
+ # Set the folder in which the tests are run
4
+ env_vars: {
5
+ key: " PROJECT"
6
+ value: " appengine/websockets"
7
+ }
8
+
9
+ # Tell the trampoline which build file to use.
10
+ env_vars: {
11
+ key: " TRAMPOLINE_BUILD_FILE"
12
+ value: " github/nodejs-docs-samples/.kokoro/build.sh"
13
+ }
14
+
15
+ env_vars: {
16
+ key: " TRAMPOLINE_IMAGE"
17
+ value: " gcr.io/cloud-devrel-kokoro-resources/node:10-puppeteer"
18
+ }
Original file line number Diff line number Diff line change
1
+ # Format: //devtools/kokoro/config/proto/build.proto
2
+
3
+ # Set the folder in which the tests are run
4
+ env_vars: {
5
+ key: " PROJECT"
6
+ value: " appengine/websockets"
7
+ }
8
+
9
+ # Tell the trampoline which build file to use.
10
+ env_vars: {
11
+ key: " TRAMPOLINE_BUILD_FILE"
12
+ value: " github/nodejs-docs-samples/.kokoro/build.sh"
13
+ }
14
+
15
+ # Configure the docker image for kokoro-trampoline.
16
+ env_vars: {
17
+ key: " TRAMPOLINE_IMAGE"
18
+ value: " gcr.io/cloud-devrel-kokoro-resources/node:12-puppeteer"
19
+ }
Original file line number Diff line number Diff line change @@ -39,3 +39,5 @@ if (module === require.main) {
39
39
} ) ;
40
40
}
41
41
// [END appengine_websockets_app]
42
+
43
+ module . exports = server
Original file line number Diff line number Diff line change 6
6
"license" : " Apache Version 2.0" ,
7
7
"author" : " Google Inc." ,
8
8
"engines" : {
9
- "node" : " >=8.0.0 "
9
+ "node" : " >=10.18.1 "
10
10
},
11
11
"scripts" : {
12
12
"deploy" : " gcloud app deploy" ,
Original file line number Diff line number Diff line change 1
1
const supertest = require ( 'supertest' ) ;
2
2
const path = require ( 'path' ) ;
3
- const app = require ( path . join ( __dirname , '../' , 'app.js' ) ) ;
3
+ const app = require ( path . join ( path . dirname ( __dirname ) , 'app.js' ) ) ;
4
4
5
5
it ( 'should be listening' , async ( ) => {
6
6
await supertest ( app ) . get ( '/' ) . expect ( 200 ) ;
Original file line number Diff line number Diff line change 15
15
'use strict' ;
16
16
17
17
const assert = require ( 'assert' ) ;
18
+ const path = require ( 'path' ) ;
19
+ const app = require ( path . join ( path . dirname ( __dirname ) , 'app.js' ) ) ;
18
20
const puppeteer = require ( 'puppeteer' ) ;
19
21
/* global document */
20
22
21
23
let browser , browserPage ;
22
24
23
25
before ( async ( ) => {
24
- browser = await puppeteer . launch ( ) ;
26
+ const PORT = process . env . PORT || 8080 ;
27
+ app . listen ( PORT , ( ) => { } ) ;
28
+
29
+ browser = await puppeteer . launch ( {
30
+ args : [
31
+ '--no-sandbox' ,
32
+ '--disable-setuid-sandbox' ,
33
+ ] } ) ;
25
34
browserPage = await browser . newPage ( ) ;
26
35
} ) ;
27
36
28
37
after ( async ( ) => {
29
38
await browser . close ( ) ;
39
+ await app . close ( ) ;
30
40
} ) ;
31
41
32
42
describe ( 'appengine_websockets_app' , ( ) => {
You can’t perform that action at this time.
0 commit comments