1
0

build-exe-for-python-sdk-assets.spec.ts 970 B

12345678910111213141516171819202122232425262728
  1. import { spawnSync } from 'node:child_process'
  2. import { resolve } from 'node:path'
  3. import { describe, expect, it } from 'vitest'
  4. const root = resolve(import.meta.dirname, '..')
  5. const script = resolve(root, 'scripts/build-exe-for-python-sdk.ts')
  6. describe('Python runtime executable assets', () => {
  7. it('packages the dynamically resolved web frontend distribution', () => {
  8. const result = spawnSync(process.execPath, [
  9. '--import',
  10. 'tsx/esm',
  11. script,
  12. '--skip-build',
  13. '--dry-run',
  14. '--targets=node24-macos-arm64',
  15. ], {
  16. cwd: root,
  17. encoding: 'utf8',
  18. env: { ...process.env, npm_execpath: 'C:\\tools\\pnpm.cjs' },
  19. })
  20. expect(result.status).toBe(0)
  21. expect(result.stdout).toContain('node_modules/@deepseek-ai/dsh-web-frontend/dist/**/*')
  22. expect(result.stdout).toContain('node_modules/@deepseek-ai/dsh-skill-badge/assets/**/*')
  23. expect(result.stdout).not.toContain('node_modules/**/*.py')
  24. })
  25. })