File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed
Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1010 "node/no-unpublished-import" : [" off" ],
1111 "node/no-unpublished-require" : [" off" ],
1212 "node/no-unsupported-features/es-syntax" : [" off" ]
13+ },
14+ "parserOptions" : {
15+ "sourceType" : " module"
1316 }
1417}
Original file line number Diff line number Diff line change 1414
1515// [START cloudrun_helloworld_service]
1616// [START run_helloworld_service]
17- const express = require ( 'express' ) ;
17+ import express from 'express' ;
1818const app = express ( ) ;
1919
2020app . get ( '/' , ( req , res ) => {
@@ -30,4 +30,4 @@ app.listen(port, () => {
3030// [END cloudrun_helloworld_service]
3131
3232// Exports for testing purposes.
33- module . exports = app ;
33+ export default app ;
Original file line number Diff line number Diff line change 99 "test" : " c8 mocha -p -j 2 test/index.test.js --exit" ,
1010 "system-test" : " NAME=Cloud c8 mocha -p -j 2 test/system.test.js --timeout=180000"
1111 },
12+ "type" : " module" ,
1213 "engines" : {
1314 "node" : " >=16.0.0"
1415 },
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
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' ;
1818
1919let request ;
2020describe ( 'Unit Tests' , ( ) => {
2121 before ( ( ) => {
22- const app = require ( path . join ( __dirname , '..' , 'index' ) ) ;
2322 request = supertest ( app ) ;
2423 } ) ;
2524
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
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' ;
1919const auth = new GoogleAuth ( ) ;
2020
2121const get = ( route , base_url ) => {
You can’t perform that action at this time.
0 commit comments