> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quiesco.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Runtime synchronization

> Change what the driver waits for during a test: turn trackers off, or ignore more requests and elements.

Every call waits for the app to be idle ([synchronization](https://docs.quiesco.dev/sync.md)). When one screen keeps the app busy —
it polls, animates forever, or holds a request open — `app.sync` changes what Quiesco waits for, for the
rest of the test, instead of switching synchronization off altogether.

```ts theme={null}
// a dashboard that polls every 200 ms and shows a live counter
await app.sync.disableTracker('timer');
await app.sync.ignoreElements.add('poll-count');
```

The changes last until the end of the test and are undone before the next one. They survive relaunches and
reconnects. To skip waiting for a single call only, `{ sync: false }` still works
([call options](https://docs.quiesco.dev/api.md#call-options)).

## Trackers

### `disableTracker(name)`

```ts theme={null}
disableTracker(name: TrackerName): Promise<void>
```

Types: [`TrackerName`](./api-types#trackername)

Stops waiting for one [tracker](https://docs.quiesco.dev/sync.md#trackers): one source of busyness.

```ts theme={null}
// the live-scores screen polls every 200 ms
await app.sync.disableTracker('timer');
await app.tap('live-scores');
```

`name` is one of `network`, `timer`, `react`, `idle-callback`, `frame-stable`, `native` and
`native-module` (on when the build wraps native modules: [native module calls](https://docs.quiesco.dev/sync.md#native-module-calls)).
Another name throws a `RangeError`.

### `enableTracker(name)`

```ts theme={null}
enableTracker(name: TrackerName): Promise<void>
```

Types: [`TrackerName`](./api-types#trackername)

Waits for a tracker again, also one the config turns off.

```ts theme={null}
await app.sync.disableTracker('timer');
await app.tap('live-scores');
await app.goBack();
await app.sync.enableTracker('timer');
```

### `disable()`

```ts theme={null}
disable(): Promise<void>
```

Stops waiting for the app altogether: every tracker is off until `enable()` (Detox
`disableSynchronization`).

```ts theme={null}
// a splash animation that never settles
await app.sync.disable();
await app.expectVisible('splash');
```

### `enable()`

```ts theme={null}
enable(): Promise<void>
```

Waits for the app again: the trackers are as configured, with the changes made by `disableTracker` and
`enableTracker` still in effect.

```ts theme={null}
await app.sync.disable();
await app.tap('skip-intro');
await app.sync.enable();
```

## Ignore lists

### `ignoreUrls.add(pattern)` / `ignoreUrls.remove(pattern)`

```ts theme={null}
ignoreUrls.add(pattern: string | RegExp): Promise<void>
ignoreUrls.remove(pattern: string | RegExp): Promise<void>
```

Adds a URL to, or removes it from, the requests the `network` tracker ignores, on top of the config's
`sync.ignoreUrls` ([configuration](https://docs.quiesco.dev/config.md#sync)). `pattern` is a string or a regular expression.

```ts theme={null}
// an analytics request that never finishes
await app.sync.ignoreUrls.add(/\/analytics/);

// a long poll on the chat screen
await app.sync.ignoreUrls.add('/chat/poll');
```

`remove` also takes out a pattern that comes from the config, for the rest of the test.

### `ignoreElements.add(target)` / `ignoreElements.remove(target)`

```ts theme={null}
ignoreElements.add(target: MatcherInput): Promise<void>
ignoreElements.remove(target: MatcherInput): Promise<void>
```

Types: [`MatcherInput`](./api-types#matcherinput)

Adds an element to, or removes it from, the elements the `frame-stable` tracker leaves out, on top of the
config's `sync.ignoreElements` ([configuration](https://docs.quiesco.dev/config.md#sync)). `target` is a
[matcher](https://docs.quiesco.dev/api-matchers.md).

```ts theme={null}
// its text changes with every poll
await app.sync.ignoreElements.add('poll-count');

// a spinner in the header that keeps rotating
await app.sync.ignoreElements.add({ type: SemanticType.progress, within: 'header' });
```

`remove` also takes out a matcher that comes from the config, for the rest of the test.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.