Skip to content

Commit

Permalink
Remove use of "fs-extra" from node analytics tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Sep 9, 2024
1 parent 91767e6 commit 44f0a62
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions integration-tests/tests/src/node/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
//
////////////////////////////////////////////////////////////////////////////

import * as os from "os";
import * as process from "process";
import * as path from "path";
import { fileURLToPath } from "url";
import os from "node:os";
import process from "node:process";
import path from "node:path";
import fs from "node:fs";
import { fileURLToPath } from "node:url";

import { expect } from "chai";
import { collectPlatformData } from "realm/scripts/submit-analytics";

import fse from "fs-extra";

// emulate old __dirname: https://flaviocopes.com/fix-dirname-not-defined-es-module-scope/
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -39,7 +38,7 @@ describe("Analytics", () => {

function getRealmVersion() {
const packageJsonPath = path.resolve(__dirname, "../../../../packages/realm/package.json");
const packageJson = fse.readJsonSync(packageJsonPath);
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
return packageJson["version"];
}

Expand Down

0 comments on commit 44f0a62

Please sign in to comment.