Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
"preinstall": "yarn submodule && node build.js",
"prepack": "shx chmod -R +x ./bin",
"submodule": "git submodule update --init --recursive",
"test": "mocha test",
"test": "node --test test/**/*-test.js",
"prepare": "husky"
},
"devDependencies": {
"@electron/get": "^4.0.1",
"extract-zip": "^1.5.0",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",
"mocha": "^10.8.2",
"oxfmt": "^0.44.0",
"oxlint": "^1.59.0",
"shx": "^0.3.3",
Expand Down
30 changes: 13 additions & 17 deletions test/minidump-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from 'node:assert';
import fs from 'node:fs';
import path from 'node:path';
import { describe, it, before, after } from 'node:test';

import * as minidump from '../lib/minidump.js';

Expand All @@ -10,15 +11,10 @@ import temp from 'temp';

temp.track();

const describe = global.describe;
const it = global.it;

describe('minidump', function () {
this.timeout(3 * 60 * 1000);

describe('minidump', { timeout: 3 * 60 * 1000 }, function () {
describe('walkStack()', function () {
describe('macOS dump', function () {
it('calls back with a report', function (done) {
it('calls back with a report', function (t, done) {
downloadElectronSymbols('darwin', function (error, symbolsPath) {
if (error) return done(error);

Expand All @@ -43,7 +39,7 @@ describe('minidump', function () {
});

describe('Windows dump', function () {
it('calls back with a report', function (done) {
it('calls back with a report', function (t, done) {
downloadElectronSymbols('win32', function (error, symbolsPath) {
if (error) return done(error);

Expand All @@ -68,7 +64,7 @@ describe('minidump', function () {
});

describe('Linux dump', function () {
it('calls back with a report', function (done) {
it('calls back with a report', function (t, done) {
downloadElectronSymbols('linux', function (error, symbolsPath) {
if (error) return done(error);

Expand All @@ -87,7 +83,7 @@ describe('minidump', function () {
});

describe('dumpSymbol()', function () {
it('calls back with a minidump', function (done) {
it('calls back with a minidump', function (t, done) {
downloadElectron(function (error, binaryPath) {
if (error) return done(error);
minidump.dumpSymbol(binaryPath, function (error, minidump) {
Expand All @@ -102,7 +98,7 @@ describe('minidump', function () {
});

describe('dump()', function () {
it('calls back with minidump info', function (done) {
it('calls back with minidump info', function (t, done) {
minidump.dump(path.join(import.meta.dirname, 'fixtures', 'linux.dmp'), (err, rep) => {
if (err) {
// do nothing, errors are fine here
Expand All @@ -117,7 +113,7 @@ describe('minidump', function () {

describe('moduleList()', function () {
describe('on a Linux dump', () => {
it('calls back with a module list', function (done) {
it('calls back with a module list', function (t, done) {
const dumpPath = path.join(import.meta.dirname, 'fixtures', 'linux.dmp');
minidump.moduleList(dumpPath, (err, modules) => {
if (err) return done(err);
Expand All @@ -129,7 +125,7 @@ describe('minidump', function () {
});

describe('on a Windows dump', () => {
it('calls back with a module list', function (done) {
it('calls back with a module list', function (t, done) {
const dumpPath = path.join(import.meta.dirname, 'fixtures', 'windows.dmp');
minidump.moduleList(dumpPath, (err, modules) => {
if (err) return done(err);
Expand All @@ -141,7 +137,7 @@ describe('minidump', function () {
});

describe('on a macOS dump', () => {
it('calls back with a module list', function (done) {
it('calls back with a module list', function (t, done) {
const dumpPath = path.join(import.meta.dirname, 'fixtures', 'mac.dmp');
minidump.moduleList(dumpPath, (err, modules) => {
if (err) return done(err);
Expand All @@ -159,7 +155,7 @@ describe('minidump', function () {
return dumpPath;
}

it('returns an error for a truncated header', function (done) {
it('returns an error for a truncated header', function (t, done) {
const dumpPath = writeDump(Buffer.alloc(16));
minidump.moduleList(dumpPath, (err, modules) => {
assert(err instanceof Error, 'expected an Error');
Expand All @@ -169,7 +165,7 @@ describe('minidump', function () {
});
});

it('returns an error for an invalid magic signature', function (done) {
it('returns an error for an invalid magic signature', function (t, done) {
const dumpPath = writeDump(Buffer.alloc(32));
minidump.moduleList(dumpPath, (err, modules) => {
assert(err instanceof Error, 'expected an Error');
Expand All @@ -179,7 +175,7 @@ describe('minidump', function () {
});
});

it('returns an error for an out-of-bounds stream_directory_rva', function (done) {
it('returns an error for an out-of-bounds stream_directory_rva', function (t, done) {
const buf = Buffer.alloc(32);
buf.writeUInt32LE(0x504d444d, 0); // 'MDMP'
buf.writeUInt32LE(0xa793, 4); // version
Expand Down
Loading