"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
const path_1 = tslib_1.__importDefault(require("path"));
const heap_adapter_1 = tslib_1.__importDefault(require("../middlewares/ios/adapter/heap-adapter"));
describe('ios heap 适配器', () => {
    it('snapshot转换', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
        const src = path_1.default.join(__dirname, '../__mock__/jsc-heap.json');
        const dest = path_1.default.join(__dirname, '../__mock__/converted-v8-heap.heapsnapshot');
        const data = yield fs_1.default.promises.readFile(src);
        const jscJson = JSON.parse(data.toString());
        const v8Json = heap_adapter_1.default.jsc2v8(jscJson);
        yield fs_1.default.promises.writeFile(dest, JSON.stringify(v8Json));
        expect(v8Json.nodes.length).toBeGreaterThan(0);
        expect(v8Json.edges.length).toBeGreaterThan(0);
    }));
});
