UNPKG

@hayspec/spec

Version:

Core logic for Hayspec framework.

77 lines (72 loc) 5 kB
>>> @hayspec/spec npx nyc npx ava --verbose ✖ Timed out while running tests ✔ asserts › is.ts › succeeds for equal values ✔ asserts › is.ts › fails for not equal values ✔ asserts › deep-equal.ts › succeeds for equal values ✔ asserts › deep-equal.ts › fails for not equal values ✔ asserts › throws.ts › succeeds for values that throw ✔ asserts › throws.ts › succeeds for values that do not throw ✔ index.ts › exposes Spec class ✔ index.ts › exposes Stage class ✔ index.ts › exposes Context class ✔ asserts › truthy.ts › succeeds for true values ✔ asserts › truthy.ts › fails for false values ✔ core › reporter.ts › triggers recipe callbacks ✔ core › reporter.ts › memorizes spec block level ✔ core › context.ts › methods `set()` and `get()` manages values (107ms) ✔ core › context.ts › methods `get()` inherits values from stage (106ms) ✔ core › context.ts › method `pass()` passes the test (105ms) ✔ core › context.ts › method `fail()` fails the test ✔ core › context.ts › method `truthy()` asserts that value is truthy ✔ core › context.ts › method `falsy()` asserts that value is falsy ✔ core › context.ts › method `true()` asserts that value is true ✔ core › context.ts › method `false()` asserts that value is false ✔ core › context.ts › method `is()` asserts that two values are equal ✔ core › context.ts › method `not()` asserts that two values are not equal ✔ core › context.ts › method `regex()` asserts that string maches regular expression ✔ core › context.ts › method `notRegex()` asserts that string does not maches regular expression ✔ core › context.ts › method `deepEqual()` asserts that two objects are equal ✔ core › context.ts › method `notDeepEqual()` asserts that two objects are equal ✔ core › context.ts › method `throws()` asserts that function throws an error ✔ core › context.ts › method `notThrows()` asserts that function does not throw an error ✔ core › context.ts › methods `exec()` returns terminal command result (118ms) ✔ core › context.ts › methods `request()` returns supertest instance (250ms) ✔ core › spec.ts › method spec() appends new spec with shared stage instance ✔ core › spec.ts › context instance is shared between atomic stack ✔ core › spec.ts › method isRoot() indicates if the spec is nested or not ✔ core › spec.ts › method perform() performs only selected tests ✔ core › spec.ts › method perform() ignores skipped tests ✔ core › spec.ts › method perform() executes spec stack ✔ core › context.ts › method `sleep()` continues with timeout (4s) ✔ methods › exec.ts › executes terminal command ✔ core › stage.ts › methods `set()` and `get()` manages values ✔ core › stage.ts › methods `exec()` returns terminal command result ✔ core › stage.ts › methods `request()` returns supertest instance (344ms) ✔ methods › request.ts › performs a http request (168ms) ✔ methods › request.ts › handles errors (367ms) ✔ core › stage.ts › method `sleep()` continues with timeout (4s) ✔ methods › sleep.ts › continues with timeout (2s) ─ 46 tests passed ----------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------|---------|----------|---------|---------|------------------- All files | 97.58 | 89.52 | 98.02 | 97.36 | src | 100 | 100 | 100 | 100 | index.ts | 100 | 100 | 100 | 100 | src/asserts | 92.86 | 90.91 | 100 | 92.31 | deep-equal.ts | 84.62 | 85.71 | 100 | 84.62 | 13,22 is.ts | 100 | 83.33 | 100 | 100 | 9 throws.ts | 100 | 100 | 100 | 100 | truthy.ts | 100 | 100 | 100 | 100 | src/core | 98.24 | 89.89 | 97.78 | 98.08 | context.ts | 100 | 90 | 100 | 100 | 241 reporter.ts | 98.11 | 96.43 | 92.86 | 98.08 | 89 spec.ts | 96.95 | 86.27 | 96.55 | 96.43 | 73,91,117,130 stage.ts | 100 | 100 | 100 | 100 | src/methods | 92.31 | 50 | 100 | 91.67 | exec.ts | 100 | 100 | 100 | 100 | request.ts | 83.33 | 50 | 100 | 83.33 | 19 sleep.ts | 100 | 100 | 100 | 100 | ----------------|---------|----------|---------|---------|-------------------