1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- 'use strict' ;
16-
17- const assert = require ( 'assert' ) ;
18- const path = require ( 'path' ) ;
19- const supertest = require ( 'supertest' ) ;
15+ import assert from 'assert' ;
16+ import path from 'path' ;
17+ import supertest from 'supertest' ;
2018
2119describe ( 'Editor unit tests' , ( ) => {
2220 describe ( 'Initialize app' , ( ) => {
2321 it ( 'should successfully load the index page' , async ( ) => {
24- const { app} = require ( path . join ( __dirname , '..' , 'app' ) ) ;
22+ import { app } from path . join ( __dirname , '..' , 'app' ) ;
2523 const request = supertest ( app ) ;
2624 await request . get ( '/' ) . retry ( 3 ) . expect ( 200 ) ;
2725 } ) ;
@@ -31,7 +29,7 @@ describe('Editor unit tests', () => {
3129 let template ;
3230
3331 before ( async ( ) => {
34- const { buildRenderedHtml} = require ( path . join ( __dirname , '..' , 'app' ) ) ;
32+ import { buildRenderedHtml } from path . join ( __dirname , '..' , 'app' ) ;
3533 template = await buildRenderedHtml ( ) ;
3634 } ) ;
3735
@@ -48,7 +46,7 @@ describe('Integration tests', () => {
4846
4947 before ( async ( ) => {
5048 process . env . EDITOR_UPSTREAM_RENDER_URL = 'https://www.example.com/' ;
51- const { app} = require ( path . join ( __dirname , '..' , 'app' ) ) ;
49+ import { app } from path . join ( __dirname , '..' , 'app' ) ;
5250 request = supertest ( app ) ;
5351 } ) ;
5452
0 commit comments