Skip to content

Commit 50288d1

Browse files
committed
refactor: replace legacy __dirname with import.meta.dirname
1 parent fef0bca commit 50288d1

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

test/extractor/index.unit.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Import Node.js Dependencies
22
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
43
import { test } from "node:test";
54
import assert from "node:assert";
65

@@ -11,7 +10,6 @@ import {
1110
} from "../../src/extractor/index.ts";
1211

1312
// CONSTANTS
14-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
1513
const kFixturesDir = path.join(__dirname, "..", "fixtures");
1614
const kExtractorFixture = path.join(kFixturesDir, "extractor");
1715

test/strategies/github_advisory_npm/index.integration.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Import Node.js Dependencies
22
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
43
import { test } from "node:test";
54
import assert from "node:assert";
65

@@ -14,7 +13,7 @@ import {
1413
} from "../utils.ts";
1514

1615
// CONSTANTS
17-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
16+
const __dirname = import.meta.dirname;
1817
const kFixturesDir = path.join(__dirname, "..", "..", "fixtures");
1918

2019
function expectNpmAuditVulnToBeGithubAdvisory(vuln: NpmAuditAdvisory) {

test/strategies/github_advisory_pnpm/index.integration.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Import Node.js Dependencies
22
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
43
import { test } from "node:test";
54
import assert from "node:assert";
65

@@ -12,7 +11,7 @@ import {
1211
import { expectVulnToBeNodeSecureStandardCompliant } from "../utils.ts";
1312

1413
// CONSTANTS
15-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
14+
const __dirname = import.meta.dirname;
1615
const kFixturesDir = path.join(__dirname, "..", "..", "fixtures");
1716

1817
function expectNpmVulnToBePnpmAdvisory(vuln: PnpmAuditAdvisory) {

0 commit comments

Comments
 (0)