True 4.0.0

$_true-context (list) [private]

scss
$_true-context: ();

Stores the current module/test/assertion context stack

Used By

@mixin _true-context() [private]

@mixin _true-context-pop() [private]

@function _true-context() [private]

@function _true-context-all() [private]

@mixin _true-context() [private]

Update the current context for a given scope

Parameters

$scope: (string)

Either module, test or assert

$name: (string)

Name or description of the current scope

Requires

$_true-context (list) [private]

Used By

@mixin assert()

@mixin assert-true()

@mixin _true-module-start() [private]

@mixin _true-test-start() [private]

@mixin _true-context-pop() [private]

Remove the deepest context layer from $_true-context

Requires

$_true-context (list) [private]

Used By

@mixin assert()

@mixin _true-assert-results() [private]

@mixin _true-module-stop() [private]

@mixin _true-test-stop() [private]

$_true-output-context (list) [private]

scss
$_true-output-context: ();

Make sure every output test includes an assert, output, and expect/contains

Used By

@mixin _true-output-context() [private]

@mixin _true-output-context() [private]

Add assert, output, expect, or contains context to an output test, or check to make sure they all exist before resetting the context.

Parameters

$new: ('assert' | 'output' | 'expect' | 'contains' | null)

Add a new assert, output, expect, or contains layer to the context of an output-test, or use null to check that all context is properly formed and then reset it at the end of a test

$context: $_true-output-context (list)

The current output context

Requires

@function _true-validate-output-context() [private]

$_true-output-context (list) [private]

Used By

@mixin assert()

@mixin output()

@mixin expect()

@mixin contains()

@function _true-validate-output-context() [private]

Validate the new context, and return an updated context value

Parameters & Return

$new: ('assert' | 'output' | 'expect' | 'contains' | null)

Add a new assert, output, expect, or contains layer to the context of an output-test, or use null to check that all context is properly formed and then reset it at the end of a test

$context: $_true-output-context (list)

The current output context

@return (list)

Updated output context

@error

When adding unknown context

@error

When trying to add context that already exists

@error

When assert() is missing before expect, output, or contains

@error

When context is missing before a reset

Requires

@function _true-error() [private]

Used By

@mixin _true-output-context() [private]

@function _true-context() [private]

Get information on current context for a given scope

Parameters & Return

$scope: (string)

@return (string)

Requires

$_true-context (list) [private]

Used By

@mixin assert()

@mixin assert-true()

@mixin _true-pass-details() [private]

@mixin _true-fail-details() [private]

@function _true-context-all() [private]

Get list of context names for a given scope

Parameters & Return

$scope: (string)

@return (list)

Requires

$_true-context (list) [private]

Used By

@mixin _true-module-start() [private]

@function _true-get-result() [private]

Compare two values, and return a pass or fail result.

Parameters & Return

$assert: (*)

Value to consider

$expected: (*)

Expected match

$unequal: false (bool)

Set to true if the comparison is expected to fail

@return ('pass' | 'fail')

Used By

@mixin _true-assert-results() [private]

$_true-results (Map) [private]

scss
$_true-results: (
  'run': 0,
  'pass': 0,
  'fail': 0,
  'output-to-css': 0,
);

Global test-results map

Used By

@mixin _true-update() [private]

@mixin _true-update() [private]

Update global results data

Parameters

$result: ('pass' | 'fail' | 'output-to-css')

Requires

@function _true-map-increment() [private]

$_true-results (Map) [private]

$_true-test-result (String) [private]

Used By

@mixin _true-test-stop() [private]

$_true-test-result (String) [private]

scss
$_true-test-result: null;

Used By

@mixin _true-update() [private]

@mixin _true-update-test() [private]

@mixin _true-test-stop() [private]

@mixin _true-update-test() [private]

Update test result flag with new data

Parameters

$result: ('pass' | 'fail' | 'output-to-css')

Requires

$_true-test-result (String) [private]

Used By

@mixin assert()

@mixin _true-assert-results() [private]

$_true-stats (Map<String: Number>) [private]

scss
$_true-stats: (
  'modules': 0,
  'tests': 0,
  'assertions': 0
);

Global stats count of how many modules, tests, and assertions are found

Used By

@mixin _true-update-stats-count() [private]

@mixin _true-update-stats-count() [private]

Add to a stats count type count by 1

Parameters

$type: (String)

The stats type to add to

Requires

@function _true-map-increment() [private]

$_true-stats (Map<String: Number>) [private]

Used By

@mixin assert()

@mixin _true-assert-results() [private]

@mixin _true-module-stop() [private]

@mixin _true-test-stop() [private]