node/test/parallel/test-sea-get-asset-keys.js
Joyee Cheung 6428e2e4ca
sea: implement sea.getAssetKeys()
This adds a new API to allow the bundled script in SEA to query
the list of assets.

PR-URL: https://github.com/nodejs/node/pull/59661
Refs: https://github.com/nodejs/single-executable/discussions/112
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-09-04 11:58:50 +00:00

12 lines
266 B
JavaScript

'use strict';
require('../common');
const { getAssetKeys } = require('node:sea');
const assert = require('node:assert');
// Test that getAssetKeys throws when not in SEA
assert.throws(() => getAssetKeys(), {
code: 'ERR_NOT_IN_SINGLE_EXECUTABLE_APPLICATION'
});