Skip to content

Commit dd8d83f

Browse files
committed
fix(e2e): use ESM-compatible __dirname and lodash imports for Node.js 22.22.0
1 parent 6acad24 commit dd8d83f

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

e2e/commands/export.e2e.1.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import chai, { expect } from 'chai';
22
import fs from 'fs-extra';
33
import * as path from 'path';
4+
import { fileURLToPath } from 'url';
5+
import { dirname } from 'path';
46
import { Helper } from '@teambit/legacy.e2e-helper';
57
import chaiFs from 'chai-fs';
68

79
chai.use(chaiFs);
810

11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = dirname(__filename);
13+
914
describe('bit export command', function () {
1015
this.timeout(0);
1116
let helper: Helper;

e2e/flows/big-file.e2e.2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import chai, { expect } from 'chai';
22
import fs from 'fs-extra';
33
import * as path from 'path';
4+
import { fileURLToPath } from 'url';
5+
import { dirname } from 'path';
46

57
import { Helper } from '@teambit/legacy.e2e-helper';
68
import chaiFs from 'chai-fs';
79
chai.use(chaiFs);
810

11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = dirname(__filename);
13+
914
describe('big text file', function () {
1015
this.timeout(0);
1116
let helper: Helper;

e2e/functionalities/binary-files.e2e.2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import chai, { expect } from 'chai';
22
import fs from 'fs-extra';
33
import * as path from 'path';
4+
import { fileURLToPath } from 'url';
5+
import { dirname } from 'path';
46
import { Helper } from '@teambit/legacy.e2e-helper';
57
import chaiFs from 'chai-fs';
68
chai.use(chaiFs);
79

10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = dirname(__filename);
12+
813
describe('binary files', function () {
914
this.timeout(0);
1015
let helper: Helper;

e2e/harmony/lanes/merge-lanes-unrelated.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import chai, { expect } from 'chai';
2-
import * as _ from 'lodash';
2+
import _ from 'lodash';
33
import { Helper } from '@teambit/legacy.e2e-helper';
44
import chaiFs from 'chai-fs';
55
chai.use(chaiFs);

e2e/performance/filesystem-read.e2e.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
import fs from 'fs-extra';
44
import path from 'path';
5+
import { fileURLToPath } from 'url';
6+
import { dirname } from 'path';
57
import { expect } from 'chai';
68
import { Helper } from '@teambit/legacy.e2e-helper';
7-
import * as _ from 'lodash';
9+
import _ from 'lodash';
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = dirname(__filename);
813

914
const MAX_FILES_READ = 1050;
1015
const MAX_FILES_READ_STATUS = 1500;

0 commit comments

Comments
 (0)