Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

977 B
Raw Blame
import assert from 'node:assert/strict';
import test from 'node:test';

import {
  DESKTOP_DEV_MAX_OLD_SPACE,
  withDesktopDevNodeOptions,
} from '../shared/desktop-dev-node-options.mjs';

test('adds the development heap headroom without dropping inherited options', () => {
  const result = withDesktopDevNodeOptions({ NODE_OPTIONS: '--trace-warnings' });

  assert.equal(
    result.NODE_OPTIONS,
    `--trace-warnings --max-old-space-size=${DESKTOP_DEV_MAX_OLD_SPACE}`,
  );
});

test('preserves an explicit max old-space setting', () => {
  const result = withDesktopDevNodeOptions({
    NODE_OPTIONS: '--max-old-space-size=4096 --trace-warnings',
  });

  assert.equal(result.NODE_OPTIONS, '--max-old-space-size=4096 --trace-warnings');
});

test('does not mutate the parent environment object', () => {
  const input = { NODE_OPTIONS: '' };
  const result = withDesktopDevNodeOptions(input);

  assert.equal(input.NODE_OPTIONS, '');
  assert.notEqual(result, input);
});