Loading files
9a9e3ce37This file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
/**
* The suite must never read or write the developer's real `~/.harness`.
*
* `vitest.setup.ts` moved the DATA dir to a throwaway after a spec wrote a fixture into the live
* registry. The RUNTIME dir is the same hazard in the other direction: a real `current-grid` or
* `current-node` pointer there outranks the fakes a spec puts on PATH (`gridExec.ts` resolves the
* managed runtime BEFORE PATH, by design), so the suite would measure this machine's managed
* binaries instead of the code under test.
*/
import { homedir } from 'node:os'
import { join } from 'node:path'
import { describe, expect, it } from 'vitest'
import { env } from './env.js'
const productRoot = join(homedir(), '.harness')
describe('test environment isolation', () => {
it('keeps the data dir off the developer\'s ~/.harness', () => {
expect(env.ADAPTER_DATA_DIR.startsWith(productRoot)).toBe(false)
})
it('keeps the runtime dir off the developer\'s ~/.harness, so no real managed grid or node outranks a fake on PATH', () => {
expect(env.ADAPTER_RUNTIME_DIR.startsWith(productRoot)).toBe(false)
})
})
9a9e3ce37This file is pinned to the selected release. Download the original to open it in your design tool.