File tree 5 files changed +13
-10
lines changed
5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 10
10
"node/no-unpublished-import" : [" off" ],
11
11
"node/no-unpublished-require" : [" off" ],
12
12
"node/no-unsupported-features/es-syntax" : [" off" ]
13
+ },
14
+ "parserOptions" : {
15
+ "sourceType" : " module"
13
16
}
14
17
}
Original file line number Diff line number Diff line change 14
14
15
15
// [START cloudrun_helloworld_service]
16
16
// [START run_helloworld_service]
17
- const express = require ( 'express' ) ;
17
+ import express from 'express' ;
18
18
const app = express ( ) ;
19
19
20
20
app . get ( '/' , ( req , res ) => {
@@ -30,4 +30,4 @@ app.listen(port, () => {
30
30
// [END cloudrun_helloworld_service]
31
31
32
32
// Exports for testing purposes.
33
- module . exports = app ;
33
+ export default app ;
Original file line number Diff line number Diff line change 9
9
"test" : " c8 mocha -p -j 2 test/index.test.js --exit" ,
10
10
"system-test" : " NAME=Cloud c8 mocha -p -j 2 test/system.test.js --timeout=180000"
11
11
},
12
+ "type" : " module" ,
12
13
"engines" : {
13
14
"node" : " >=16.0.0"
14
15
},
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- const assert = require ( 'assert' ) ;
16
- const path = require ( 'path' ) ;
17
- const supertest = require ( 'supertest' ) ;
15
+ import assert from 'assert' ;
16
+ import supertest from 'supertest' ;
17
+ import app from '../index.js' ;
18
18
19
19
let request ;
20
20
describe ( 'Unit Tests' , ( ) => {
21
21
before ( ( ) => {
22
- const app = require ( path . join ( __dirname , '..' , 'index' ) ) ;
23
22
request = supertest ( app ) ;
24
23
} ) ;
25
24
Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- const assert = require ( 'assert' ) ;
16
- const { execSync} = require ( 'child_process' ) ;
17
- const request = require ( 'got' ) ;
18
- const { GoogleAuth} = require ( 'google-auth-library' ) ;
15
+ import assert from 'assert' ;
16
+ import { execSync } from 'child_process' ;
17
+ import request from 'got' ;
18
+ import { GoogleAuth } from 'google-auth-library' ;
19
19
const auth = new GoogleAuth ( ) ;
20
20
21
21
const get = ( route , base_url ) => {
You can’t perform that action at this time.
0 commit comments