## DuSanity

### Sanity tests for After Effects

DuSan requires DuAEF, the Duduf After Effects Framework. Two builds of the DuSan API are available:

- `DuSan_api.jsxinc` does not include DuAEF, and can be used to compine multiple Duduf APIs with a single copy of DuAEF.
  Be careful to grab the right version of DuAEF in this case.
- `DuAEF_DuSan_api.jsxinc` includes all dependencies, with DuAEF, and is easier to include in your scripts.

Version:
  - 2.0.5
Author:
  - Nicolas Dufresne and contributors
Copyright:
  - 2022 Nicolas Dufresne, RxLaboratory
License:
  - GPL-3.0
    DuSan is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    DuSan is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with DuSan. If not, see http://www.gnu.org/licenses/.

View Source Duik_api_fordoc.jsxinc, line 34259

### Requires

- module:DuAEF>=1.0.0

### Namespaces

Test
UI

# Members

Type: `DuSanity.Level`

#### # static readonly currentLevel

The current sanity level

View Source Duik_api_fordoc.jsxinc, line 34376

Type: `int`

#### # static readonly Level

The sanity levels.

##### Properties:

Name | Type | Description
--- | --- | ---
`UNKNOWN` | `int` |
`OK` | `int` |
`INFO` | `int` |
`WARNING` | `int` |
`DANGER` | `int` |
`CRITICAL` | `int` |
`FATAL` | `int` |

View Source Duik_api_fordoc.jsxinc, line 34361

# Methods

#### # static fix(test) → {DuSanity.Level}

Fixes the issues for the given test, if possible

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test to fix

View Source Duik_api_fordoc.jsxinc, line 34383

Returns:
The level after the fix
Type: `DuSanity.Level`

#### # static init()

This function must be called once when everything in the script is ready and after `DuAEF.init`

View Source Duik_api_fordoc.jsxinc, line 35722

#### # static isEnabled(test) → {boolean}

Checks if a Sanity Test is enabled

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test

View Source Duik_api_fordoc.jsxinc, line 34461

Returns:
Type: `boolean`

#### # static isGloballyEnabled(test) → {boolean}

Checks if the fiven test is globally enabled

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test

View Source Duik_api_fordoc.jsxinc, line 34440

Returns:
True if the test is enabled
Type: `boolean`

#### # static isLiveFixEnabled(test) → {boolean}

Checks if the the live fix is enabled for the given test

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test

View Source Duik_api_fordoc.jsxinc, line 34394

Returns:
True if the test live fix is enabled
Type: `boolean`

#### # static isProjectEnabled(test) → {boolean}

Checks if the fiven test is enabled for the current project

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test

View Source Duik_api_fordoc.jsxinc, line 34427

Returns:
True if the test is enabled for the current project
Type: `boolean`

#### # static needsFix(test) → {boolean}

Checks if the fiven test needs a fix

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test to fix

View Source Duik_api_fordoc.jsxinc, line 34416

Returns:
True if the test needs a fix
Type: `boolean`

#### # static run(forceopt)

Runs all sanity tests

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`force` | `boolean` | <optional> | false | Force running all tests even if they've not timed out yet.

View Source Duik_api_fordoc.jsxinc, line 35691

#### # static runTest(dontFixopt, forceopt) → {DuSanity.Level}

Runs a test

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`dontFix` | `boolean` | <optional> | false | If false, will automatically fix the issue.
`force` | `boolean` | <optional> | false | To improve performance, the test may be automatically paused. Set this to true to force it to run if calling this method.

View Source Duik_api_fordoc.jsxinc, line 34531

Returns:
The level of the result of the test.
Type: `DuSanity.Level`

#### # static setEnabled(test, enabledopt)

Enables or disables the test

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`test` | `DuSanity.Test` |  |  | The test
`enabled` | `boolean` | <optional> | true |

View Source Duik_api_fordoc.jsxinc, line 34483

#### # static setGloballyEnabled(test, enabledopt)

Globally enables or disables the test

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`test` | `DuSanity.Test` |  |  | The test
`enabled` | `boolean` | <optional> | true |

View Source Duik_api_fordoc.jsxinc, line 34450

#### # static setLiveFixEnabled(test, enabledopt)

Enables or disables the live fix for the given test

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`test` | `DuSanity.Test` |  |  | The test
`enabled` | `boolean` | <optional> | true |

View Source Duik_api_fordoc.jsxinc, line 34405

#### # static setProjectEnabled(test, enabledopt)

Enables or disables the test for the current project only

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`test` | `DuSanity.Test` |  |  | The test
`enabled` | `boolean` | <optional> | true |

View Source Duik_api_fordoc.jsxinc, line 34502

#### # static setTimeOut(test, timeOut)

Sets the timeout for the test

##### Parameters:

Name | Type | Description
--- | --- | ---
`test` | `DuSanity.Test` | The test
`timeOut` | `int` | The time out in milliseconds.

View Source Duik_api_fordoc.jsxinc, line 34516