Skip to content

Commit c365858

Browse files
Copilotkobenguyent
andcommitted
Convert CJS to ESM: commentStep, GraphQLDataFactory, test-server
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent d494625 commit c365858

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lib/helper/GraphQLDataFactory.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const path = require('path')
1+
import path from 'path'
22

3-
const HelperModule = require('@codeceptjs/helper')
4-
const GraphQL = require('./GraphQL')
3+
import HelperModule from '@codeceptjs/helper'
4+
import GraphQL from './GraphQL.js'
55

66
/**
77
* Helper for managing remote data using GraphQL queries.
@@ -149,7 +149,7 @@ const GraphQL = require('./GraphQL')
149149
*
150150
* ## Methods
151151
*/
152-
class GraphQLDataFactory extends Helper {
152+
class GraphQLDataFactory extends HelperModule {
153153
constructor(config) {
154154
super(config)
155155

@@ -305,4 +305,4 @@ class GraphQLDataFactory extends Helper {
305305
}
306306
}
307307

308-
module.exports = GraphQLDataFactory
308+
export default GraphQLDataFactory

lib/plugin/commentStep.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const event = require('../event')
2-
const recorder = require('../recorder')
3-
const { MetaStep } = require('../step')
1+
import event from '../event.js'
2+
import recorder from '../recorder.js'
3+
import { MetaStep } from '../step.js'
44

55
let currentCommentStep
66

@@ -101,7 +101,7 @@ const defaultGlobalName = '__'
101101
* });
102102
* ```
103103
*/
104-
module.exports = function (config) {
104+
export default function (config) {
105105
console.log('commentStep is deprecated, disable it and use Section instead')
106106
console.log('const { Section: __ } = require("codeceptjs/steps")')
107107

lib/test-server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const express = require('express')
2-
const fs = require('fs')
3-
const path = require('path')
1+
import express from 'express'
2+
import fs from 'fs'
3+
import path from 'path'
44

55
/**
66
* Internal API test server to replace json-server dependency

0 commit comments

Comments
 (0)