# createFakeServices

Builds a complete [`Services`](https://docs.mapcairn.com/api/core/Services.md) from the fakes.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { createFakeServices } from "@mapcairn/core";
 
function createFakeServices(overrides?: Partial<Services>): FakeServices;
```

## Description

How to script it: script the objects under `fakes` (for example
`fakes.search.setDefaultResults(...)`). To replace a part, pass it in
`overrides`; the returned service then uses your object, and the matching
entry in `fakes` is left unused.

The default `createMapAdapter` is [`createFakeMapAdapterFactory`](https://docs.mapcairn.com/api/core/createFakeMapAdapterFactory.md), and
each adapter it builds is recorded in `fakes.maps`.

`routing`, `fileOpener`, `suggestions`, `selection` and `featureQuery` are
optional on `Services`, but the fakes include them so a test can script
routes, files, suggestions, a selected set and the features inside a shape.
To test the ui without one, pass it as
`undefined`, for example `{ routing: undefined }`.

## Parameters

- `overrides?` (`Partial<Services>`)

## Returns

`FakeServices`

## See also

- [`Services`](https://docs.mapcairn.com/api/core/Services.md)
- [`FakeServices`](https://docs.mapcairn.com/api/core/FakeServices.md)

Source: [packages/core/src/fakes/createFakeServices.ts:86](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/fakes/createFakeServices.ts#L86)
