# test.build/core/resolvers/browser.resolver.test.ts

> 19 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-resolvers-browser-resolver-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/resolvers/browser.resolver.test.ts.txt

Listed in [test.build/core/resolvers](https://banes-lab.com/api/source/testing/test.build/core/resolvers.md), after [test.build/core/resolvers/binding.resolver.test.ts](https://banes-lab.com/source/testing/test.build/core/resolvers/binding.resolver.test.ts.md) and before [test.build/core/resolvers/catalog.resolver.test.ts](https://banes-lab.com/source/testing/test.build/core/resolvers/catalog.resolver.test.ts.md).

## Contained in

- [test.build/core/resolvers](https://banes-lab.com/anatomy/testing/folder-testing-test-build-core-resolvers.md)

## Source

```typescript
import { browserCandidates, findBrowser } from "@banes-lab/build-scripts/core/resolvers/browser.resolver.ts";
import { describe, expect, it } from "vitest";
import { join } from "node:path";
import process from "node:process";
import { tmpdir } from "node:os";

const MISSING = join(tmpdir(), "no-such-browser-binary");

describe("browserCandidates", () => {
    it("lists absolute binaries only", () => {
        expect(browserCandidates().every((candidate) => candidate.length > 0)).toBe(true);
    });
});

describe("findBrowser", () => {
    it("prefers a configured binary that exists", () => {
        expect(findBrowser(process.execPath)).toBe(process.execPath);
    });

    it("falls through a configured binary that does not exist", () => {
        expect(findBrowser(MISSING)).not.toBe(MISSING);
    });
});
```
