|
1 | | -const path = require('path') |
2 | | -const { expect } = require('expect') |
3 | | -const fs = require('fs') |
| 1 | +import path from 'path' |
| 2 | +import { expect } from 'expect' |
| 3 | +import fs from 'fs' |
4 | 4 |
|
5 | | -const TestHelper = require('../support/TestHelper') |
6 | | -const REST = require('../../lib/helper/REST') |
7 | | -const Container = require('../../lib/container') |
8 | | -const Secret = require('../../lib/secret') |
| 5 | +import TestHelper from '../support/TestHelper.js' |
| 6 | +import REST from '../../lib/helper/REST.js' |
| 7 | +import Container from '../../lib/container.js' |
| 8 | +import Secret from '../../lib/secret.js' |
9 | 9 |
|
10 | 10 | const api_url = TestHelper.jsonServerUrl() |
11 | | -global.codeceptjs = require('../../lib') |
| 11 | +import * as codeceptjs from '../../lib/index.js' |
| 12 | +global.codeceptjs = codeceptjs.default || codeceptjs |
12 | 13 |
|
13 | 14 | let I |
14 | 15 | const dbFile = path.join(__dirname, '/../data/rest/db.json') |
@@ -150,7 +151,7 @@ describe('REST', () => { |
150 | 151 | }) |
151 | 152 |
|
152 | 153 | it('should be able to parse JSON responses', async () => { |
153 | | - await I.sendGetRequest('https://reqres.in/api/comments/1', { 'x-api-key': 'reqres-free-v1'}) |
| 154 | + await I.sendGetRequest('https://reqres.in/api/comments/1', { 'x-api-key': 'reqres-free-v1' }) |
154 | 155 | await jsonResponse.seeResponseCodeIsSuccessful() |
155 | 156 | await jsonResponse.seeResponseContainsKeys(['data', 'support']) |
156 | 157 | }) |
|
0 commit comments